In some cases a build will fail with this error because the dex files being merged include more than 65536 methods or strings. This can be corrected by enabling jumbo mode using a build-extras.gradle
file.
build-extras.gradle
Create a file named build-extras.gradle
in the root of your project with the following contents:
android {
defaultConfig {
multiDexEnabled true
}
}
dependencies {
compile 'com.android.support:multidex:1.0.1'
}
config.xml
Add a resource-file
node to the Android platform in config.xml
with the target path shown below. This will move the build-extras.gradle
file to the correct location when your platform is generated.
<platform name="android">
<resource-file src="build-extras.gradle" target="app/build-extras.gradle" />
...
Be sure to commit the build-extras.gradle
file to your project repo.
Error Examples:
Execution failed for task ':transformDexWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexIndexOverflowException: Cannot merge new index 65961 into a non-jumbo instruction!
Comments
0 comments
Article is closed for comments.