大佬教程收集整理的这篇文章主要介绍了android – 运行单元测试用例时的Multidex限制命中,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
Error:Error converTing bytecode to dex: Cause: com.android.dex.DexIndexOverflowException: field ID not in [0,0xffff]: 65536 Error:Execution Failed for task ':news-app:transformClassesWithDexForDebugAndroidTest'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.processException: java.util.concurrent.ExecutionException: com.android.ide.common.process.processException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.7.0_79\bin\java.exe'' finished with non-zero exit value 2
这个例外显然是因为达到了multidex限制.但是我已经为调试版本启用了multi-dex.我想当运行检测测试用例时,它们以调试模式运行.那为什么会发生这种异常呢?
我附加了build.gradle文件
apply plugin: 'com.android.application' apply plugin: 'io.fabric' android { compileSdkVersion 22 buildToolsVersion 22.0.1 defaultConfig { minSdkVersion 14 targetSdkVersion 22 applicationId "com.xyz" } buildTypes { debug { minifyEnabled false shrinkresources false multiDexEnabled true } release { minifyEnabled true shrinkresources true multiDexEnabled false } } lintOptions { warning 'InvalidPackage','GradleCompatible' } dexOptions { preDexLibraries true incremental true jumboMode = true javaMaxHeapSize "4g" } } } }
以上是大佬教程为你收集整理的android – 运行单元测试用例时的Multidex限制命中全部内容,希望文章能够帮你解决android – 运行单元测试用例时的Multidex限制命中所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。