Android: Jumbo Mode vs Multidex

I’m not totally sure what the difference is between setting dex option “jumbomode” to true vs adding multidex support.

Setting jumbo mode to true or multidex to true seems to fix the problem below

  • Make Android WebView not store cookies or passwords
  • android.text.format.DateFormat “HH” is not recognized like with java.text.SimpleDateFormat
  • Show only two digit after decimal
  • How can I include strings from another module in Android Studio
  • How to get programmatically a list of colors from a gradient on Android
  • Android byte array to Bitmap How to
  • AGPBI: {"kind":"SIMPLE","text":"UNEXPECTED TOP-LEVEL EXCEPTION:","position":{},"original":"UNEXPECTED TOP-LEVEL EXCEPTION:"}
    AGPBI: {"kind":"SIMPLE","text":"com.android.dex.DexIndexOverflowException: Cannot merge new index 65772 into a non-jumbo instruction!","position":{},"original":"com.android.dex.DexIndexOverflowException: Cannot merge new index 65772 into a non-jumbo instruction!"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:109)","position":{},"original":"\tat com.android.dx.merge.InstructionTransformer.jumboCheck(InstructionTransformer.java:109)"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.merge.InstructionTransformer.access$800(InstructionTransformer.java:26)","position":{},"original":"\tat com.android.dx.merge.InstructionTransformer.access$800(InstructionTransformer.java:26)"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.merge.InstructionTransformer$StringVisitor.visit(InstructionTransformer.java:72)","position":{},"original":"\tat com.android.dx.merge.InstructionTransformer$StringVisitor.visit(InstructionTransformer.java:72)"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.io.CodeReader.callVisit(CodeReader.java:114)","position":{},"original":"\tat com.android.dx.io.CodeReader.callVisit(CodeReader.java:114)"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.io.CodeReader.visitAll(CodeReader.java:89)","position":{},"original":"\tat com.android.dx.io.CodeReader.visitAll(CodeReader.java:89)"}
    AGPBI: {"kind":"SIMPLE","text":"\tat com.android.dx.merge.InstructionTransformer.transform(InstructionTransformer.java:49)","position":{},"original":"\tat com.android.dx.merge.InstructionTransformer.transform(InstructionTransformer.java:49)"}
    ...
    

    Related posts:

    Has native Android BLE GATT implementation synchronous nature?
    Background service needs to send GPS location on server
    how to set grid view item as selected
    Modifying the color of an android drawable
    Hardware accelerated FFmpeg on android?
    Error while updating ADT 23.0.0 in eclipse
  • Exception in loading layout: java.util.LinkedHashMap.eldest()Ljava/util/Map$Entry;
  • Why does Butterknife @Bind fail in release build (after proguard)
  • Android: Adding a simple Fragment
  • How to properly implement onRestoreInstanceState() for a DialogPreference subclass?
  • Android: java.lang.SecurityException: Permission Denial: start Intent
  • how to create Socket connection in Android?
  • 2 Solutions collect form web for “Android: Jumbo Mode vs Multidex”

    Jumbo Mode, when reading
    https://source.android.com/devices/tech/dalvik/dalvik-bytecode.html, the const-string/jumbo is the jumbo mode for string. It is about the opcode such that “op vAA, string@BBBBBBBB” versus “op vAA, string@BBBB”, 32 bits versus 16 bit.

    Multi Dex is to allow to load classes from more than one dex file. The primary classes.dex must contain the classes necessary for calling this class methods. Secondary dex files found in the application apk will be added to the classloader after first call to MultiDex.install(Context)
    see https://developer.android.com/reference/android/support/multidex/MultiDex.html

    take a look into this (search for jumbo):

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

    in short:
    – similar to Android Method count limit (64K) – there’s a limit on string count (64K)
    – to overcome this limit – jumbo mode enables referencing more than 2^16 strings by using special opCode that enables encoding up to 2^32 strings.

    in practice:
    – from my experience both (MultiDex & JumboMode) have major impact on apk installation time (much slower).

    hope this helps:)

    Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.