我项目的gradle文件如下。
android {
compileSdkVersion 23
buildToolsVersion "25.0.1"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
}
在 Android Studio 中“生成签名的 APK”时,我可以看到 DexIndexOverflowException。
Error:Execution failed for task ':MyProject:transformClassesWithDexForRelease'.
> 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
我已经知道这个错误并阅读了文档(https://developer.android.com/studio/build/multidex.html)。
只是我想检查一下超过了多少dex。
例如:
trouble writing output:
Too many field references: 99999; max is 65536.
You may try using --multi-dex option.
请找到解决方案。
最佳答案
Android Studio 有一个 APK analyzer显示此信息,不需要 gradle 插件。
关于android - 我如何检查android中的dex计数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41758284/