My project's gradle file is as below.
android {
compileSdkVersion 23
buildToolsVersion "25.0.1"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
}
I can see DexIndexOverflowException when "Generate Signed APK" in Android Studio.
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
I already know this error and read the document(https://developer.android.com/studio/build/multidex.html).
Just I want to check How many dex has exceeded.
For example:
trouble writing output:
Too many field references: 99999; max is 65536.
You may try using --multi-dex option.
Please find a solution.
Android Studio has an APK analyzer that shows this information, no gradle plugins required.
use this plugin to get the number of method references in your APK on every build.
dexcount
Take a look at this. I was searching for the same and found my answer here. Basicly, you have to generate the APK of your project and then go to Build->Analyze APK and at the rasults click on classes.dex, then, below you will see exactly how many methods are defined and referenced by the project.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With