Search code examples
androidandroid-build

Android Build: Dex Jumbo Mode in Gradle


I am using following line in android ant build (project.properties):

dex.force.jumbo=true

Now we are migrating from ant to Gradle. Is it possible to get jumbo mode active in Android Gradle build?


Solution

  • You can modify your build.gradle file to include:

    android {
        dexOptions {
            jumboMode = true
        }
    }
    

    Please note that this option is only supported by the now deprecated DX compiler. The D8 compiler does not support this option. From AGP 7.0 (released with Android Studio 2020.3.1 - Arctic Fox) DX support is removed completely.