DexException: cannot combine new index 65536 into statement without jumbo

For some unknown reason, my application will suddenly not be created from Android Studio.

I keep getting

> com.android.ide.common.internal.LoggedErrorException: Failed to run command: /home/martynas/android-sdk/build-tools/19.1.0/dx --dex --num-threads=4 --output ... ... ... Error Code: 2 Output: UNEXPECTED TOP-LEVEL EXCEPTION: com.android.dex.DexException: Cannot merge new index 65536 into a non-jumbo instruction! 

While the same application successfully completed from the command line. I checked the number of method links and it turned out to be below the scary 64k.

Now I am using AS 0.8.11.

+63
android android-studio android-gradle
Sep 29 '14 at 6:25
source share
5 answers

Try adding this line to your project.properties project

dex.force.jumbo = true

Which increases the limit for lines in dex files. Your project will probably be compiled.

Note. Also, with jumbo set, this is another 64K limit for methods in one dex only. If you get this limit in the future, you will need to remove some dependencies.

Update - Google Play 6.5 Services (12-08-14)

With version 6.5, Google finally disassembled Google Play Services. So now you can selectively compile the API into your executable file.

Example:

 compile 'com.google.android.gms:play-services-maps:6.5.+' compile 'com.google.android.gms:play-services-ads:6.5.+' 

For all other Google Play APIs, check this page at d.android.com .

Update (04/21/2015): https://developer.android.com/tools/building/multidex.html

+43
Sep 29 '14 at 6:32
source share

Set the jumboMode property in the build.gradle file:

 android { ... dexOptions { jumboMode true } } 

I also found this useful: Mapping the dex method by package .

+165
Oct 08 '14 at 2:52
source share

This works for me. I got com.android.dex.DexIndexOverflowException: Cannot merge new index 66636 into a non-jumbo instruction!

 android { ... dexOptions { jumboMode true } } 

If this does not work, you may have reached the limit of the method reference in dex, which is another problem. You need to use either multidex or proGuard.

+32
Jun 25 '15 at 23:06
source share

This is a merge error when the dex files that are merged have more than 65536 lines. The new index cannot fit into the const-string command, and merging with dex does not support changing instructions if they have different sizes, so it cannot be expanded to the const-string / jumbo command. This has been fixed in jb-mr1 by adding a new option: -force-jumbo. This error can be fixed by adding "dex.force.jumbo=true" to project.properties.

+10
Sep 29 '14 at 6:39
source share

With the latest version of Android Studio and the "force jumbo" flag set in the Android Studio compiler settings, this problem disappears.

-one
Mar 16 '15 at 4:17
source share



All Articles