我项目的gradle文件如下.
android { compileSdkVersion 23 buildToolsVersion "25.0.1" buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt') } } }
在Android Studio中"Generate Signed 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分析器,无需gradle插件。