运行androidTests时出现DexIndexOverflowException

时间:2016-07-12 12:43:20

标签: android android-testing multidex android-multidex

运行时./gradlew clean connectedWithAnalyticsWithCloudDebugAndroidTest我收到此错误:

* What went wrong:
Execution failed for task ':android:transformClassesWithDexForWithAnalyticsWithCloudDebug'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: method ID not in [0, 0xffff]: 65536

但是在应用程序端我很安全:./ gradlew clean assembleWithAnalyticsWithCloudRelease结束于:

Total methods in Gobandroid-2.4.1-withAnalytics-withCloud-release-unsigned.apk: 31976 (48.79% used)
Total fields in Gobandroid-2.4.1-withAnalytics-withCloud-release-unsigned.apk:  14955 (22.82% used)
Methods remaining in Gobandroid-2.4.1-withAnalytics-withCloud-release-unsigned.apk: 33559
Fields remaining in Gobandroid-2.4.1-withAnalytics-withCloud-release-unsigned.apk:  50580

BUILD SUCCESSFUL

我不想激活multidex,因为应用程序不需要它 - 但我想运行我的测试。有没有一种很好的方法只为测试启用multidex?

0 个答案:

没有答案