RobotiumTech / robotium

Android UI Testing
http://www.robotium.org
Apache License 2.0
2.86k stars 786 forks source link

Cannot find Activity class on Android7.0 #877

Closed SimuOn closed 6 years ago

SimuOn commented 6 years ago

hi,

I'm using robotium 5.6.3 in android studio 3.0.1. When testing an APP, which activity name is "com.mypkg.test12.MainActivity", I cannot find Activity class by invoking Class.forName("com.mypkg.test12.MainActivity").

Caused by: java.lang.ClassNotFoundException: Didn't find class "com.mypkg.test12.MainActivity" on path: DexPathList[[zip file "/system/framework/android.test.runner.jar", zip file "/data/app/com.mypkg.robotiumdiary.test-1/base.apk", zip file "/data/app/com.mypkg.robotiumdiary-1/base.apk"],nativeLibraryDirectories=[/data/app/com.mypkg.robotiumdiary.test-1/lib/arm64, /data/app/com.mypkg.robotiumdiary-1/lib/arm64, /system/lib64, /vendor/lib64, /system/vendor/lib64, /product/lib64]]

and my test runner package name is "com.mypkg.robotiumdiary".

I want to know, the 2 package names (test runner package and testing APP package) must be same?

SimuOn commented 6 years ago

Sorry, It's my mistake, a wrong spell in Application.id