I'm having trouble with testing an android project.
I have a debug apk with no source. The start activity class is
com.restfriedchicken.android.MainActivity
And I get it installed using
adb install -r app/build/outputs/apk/app-debug.apk
Then I create a new project with the following build.gradle and AndroidManifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.restfriedchicken.android.test">
<uses-sdk
android:minSdkVersion="17"
android:targetSdkVersion="17" />
<application android:allowBackup="false">
<!-- linkage for the test runner -->
<uses-library android:name="android.test.runner" />
</application>
<instrumentation
android:name="android.test.InstrumentationTestRunner"
android:targetPackage="com.restfriedchicken.android" />
</manifest>
apply plugin: 'com.android.application'
android {
compileSdkVersion 17
buildToolsVersion "21.1.2"
defaultConfig {
minSdkVersion 17
targetSdkVersion 17
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.jayway.android.robotium:robotium-solo:5.3.1'
compile 'com.jcraft:jsch:0.1.51'
}
But when I run tests, it reports cannot find "com.restfriedchicken.android.MainActivity":
Caused by: java.lang.ClassNotFoundException:
Didn't find class "com.restfriedchicken.android.MainActivity" on path:
DexPathList[
[
zip file "/system/framework/android.test.runner.jar",
zip file "/data/app/com.restfriedchicken.android.test.test-1.apk",
zip file "/data/app/com.restfriedchicken.android.test-1.apk"
],
nativeLibraryDirectories=[
/data/app-lib/com.restfriedchicken.android.test.test-1,
/data/app-lib/com.restfriedchicken.android.test-1,
/system/lib
]
]
It seems like the instrumentation does not succeed?