6

According to this post it allows a larger number of strings in the dex files but I don't really understand what it means and the impact on builds.

Community
  • 1
  • 1
Esteam
  • 1,911
  • 1
  • 16
  • 24

2 Answers2

5

Jumbo mode pertains to the number of strings that can be referenced in a DEX file, which by default are indexed using 16 bit wide integers. Therefore, if your application encodes more than 2^16 strings, the dx tool will fail as well. For string references however, there is a remedy: DEX supports “jumbo opcodes” which allow for 32 bit wide string references. The jumboMode flag in an Android Gradle build script enables this mode, allowing up to 2^32 strings to be referenced.

What this means is if you have more than 2^16 references in your dex files, you can use jumboMode to accommodate for this by allowing up to 2^32 references. This is done by forcing the byte code to always use "jumbo strings" (2^32) references to help avoid issues when merging dex files.

Note: this does NOT have anything to do with the number of method references, so this mode doesn't solve when your dex file has more than 64k methods.

Source: https://developers.soundcloud.com/blog/congratulations-you-have-a-lot-of-code-remedying-androids-method-limit-part-1

In my experiences, this shouldn't have any noticeable impact on builds other than a potential increase in build time.

Smalls
  • 352
  • 3
  • 13
4

When you compile your code in android, your java code will be compiled into .dex file.

There is a restriction for number of strings that can exist in the dex file. By enabling jumboMode, you increase the number of strings that can exist in your dex file.

jumboMode option is true since Gradle 2.1.0 so you dont have to worry about it.

oiyio
  • 5,219
  • 4
  • 42
  • 54