Android gradle プラグインの使用2.2.0
:
buildscript {
repositories {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "com.android.tools.build:gradle:2.2.0"
}
}
実行中./gradlew assembleDebug assembleDebugAndroidTest
:
と2.2.0
:
app-debug.apk
app-debug-androidTest.apk
と2.1.3
:
app-debug.apk
app-debug-unaligned.apk
app-debug-androidTest.apk
app-debug-androidTest-unaligned.apk
この Google の問題に基づいて: https://code.google.com/p/android/issues/detail?id=212591およびここにコメント: https://code.google.com/p/android/issues/detail?id =212591#c15 :
こんにちは、整列されていない apk を生成しなくなりました。速度向上の一環として、既に調整済みの apk を生成します。したがって、2 つではなく、最後の 1 つを取得します。
Spoon は、テスト ランナーを実行するために、これらの「整列されていない」apk を必要とします。
java -jar spoon-runner-1.7.0-jar-with-dependencies.jar \
--debug --fail-on-failure --adb-timeout 90 --no-animations \
--apk app-debug.apk \
--test-apk app-debug-androidTest-unaligned.apk
エラー:
12:06:48 I/InstrumentationResultParser: test run failed: 'Instrumentation run failed due to 'java.lang.NoClassDefFoundError''
2016-09-23 12:06:48 [STRL.testRunStarted] testCount=0 runName=<>.test
2016-09-23 12:06:48 [STRL.testRunFailed] errorMessage=Instrumentation run failed due to 'java.lang.NoClassDefFoundError'
2016-09-23 12:06:48 [STRL.testRunEnded] elapsedTime=0
12:06:48 I/XmlResultReporter: XML test result file generated at /<>/spoon-output/junit-reports/emulator-5554.xml. Total tests 0,
Spoon は「unaligned」のみを取り込むようです。
Exception in thread "main" java.lang.IllegalArgumentException: Instrumentation APK path does not exist.
at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122)
at com.squareup.spoon.SpoonRunner$Builder.setInstrumentationApk(SpoonRunner.java:360)
at com.squareup.spoon.SpoonRunner.main(SpoonRunner.java:657)