module の計測テストを実行するとtest
、次のエラーが発生します -
Test running failed: Instrumentation run failed due to 'java.lang.NoClassDefFoundError' Empty test suite.
私は2つのモジュールを持つプロジェクトを持っています: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>