DEX Code Optimization
From February 2027 Google Play requires release builds to reach at least 25% in DEX code optimization. Apply the two steps below so your app meets this requirement.
Step 1: Update the Release Build Type
Add the optimization block to the release build type of your app module.
- Kotlin DSL
- Groovy
app/build.gradle.kts
android {
buildTypes {
release {
// your existing settings
optimization {
keepRules {
ignoreFrom(
"com.applovin.mediation:vungle-adapter",
"com.applovin.mediation:inmobi-adapter",
"com.google.ads.mediation:inmobi"
)
}
}
}
}
}
app/build.gradle
android {
buildTypes {
release {
// your existing settings
optimization {
keepRules {
ignoreFrom("com.applovin.mediation:vungle-adapter",
"com.applovin.mediation:inmobi-adapter",
"com.google.ads.mediation:inmobi")
}
}
}
}
}
note
The ignoreFrom call needs Android Gradle Plugin 8.6 or newer.
Step 2: Add the ProGuard Rules
Add these rules to the ProGuard file of your app module.
app/proguard-rules.pro
-keep class com.vungle.ads.** { *; }
-keep class com.inmobi.** { *; }
-keep class com.squareup.picasso.** { *; }
-keep class androidx.browser.customtabs.CustomTabsService { *; }
-keep class androidx.recyclerview.widget.RecyclerView { *; }
-keep class * implements com.google.gson.TypeAdapterFactory
-keep class * implements com.google.gson.JsonSerializer
-keep class * implements com.google.gson.JsonDeserializer
-keepattributes Signature
-keepattributes *Annotation*
-dontwarn com.inmobi.**
-dontwarn com.squareup.okhttp.**
-dontwarn com.moat.**
-dontwarn sun.misc.**