在运行模块test
的检测测试时,我收到以下错误 -
Test running failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError' Empty test suite.
我有一个包含两个模块的项目:app
和test
这是build.gradle
(测试)`
apply plugin: 'com.android.test'
android{
compileSdkVersion 19
buildToolsVersion "21.1.2"
defaultConfig{
testApplicationId 'com.xx.android.test'
testInstrumentationRunner com.xx.android.test.CustomRunner'
}
targetProjectPath ':app'
targetVariant 'debug'
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
}
&安培;这是测试模块的AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.xx.android.test">
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="19" />
<application>
<uses-library android:name="android.test.runner" />
</application>
<instrumentation android:name=".CustomRunner"
android:targetPackage="com.xx.android"
android:handleProfiling="false"
android:functionalTest="false"
android:label="Instrumentation test"/>
</manifest>