Google's 2027 DEX Optimization Bar Turns Whole-Package `-keep` Rules into a Release Blocker
From February 2027, apps with large DEX files that don't hit 25% shrinking, optimization, and obfuscation will lose Google Play visibility and may be blocked from publishing; SDK authors with broad `-keep` rules are therefore handing every downstream app a compliance problem.
Starting February 2027, Google Play will require apps with uncompressed DEX of at least 10MB in the AAB (50MB for games) to shrink, optimize, and obfuscate at least 25% of code items each. Play Console already shows the metrics; missing the bar affects visibility and publishing.
The biggest obstacle is the common SDK practice of adding a blanket `-keep class com.example.** { *; }` to consumer rules to protect reflection and JNI call sites. Those rules get merged into every downstream app's R8 configuration, and a single package-level keep can freeze tens of thousands of code items, blocking shrinking, optimization, and obfuscation. The effect can even override finer rules from other SDKs, like a library keeping all of `com.google.android.gms.**`.
R8 Configuration Analyzer shows which rules retain which classes, fields, and methods, and flags subsumed rules. The command chain goes from `android analyze app-release.aab` for the final DEX and optimization ratios, to `android analyze --analysis=optimization -f json library.aar` for an AAR's own rules, to `./gradlew :app:analyzeReleaseR8Config` on AGP 9.3+ to generate a keep-rule impact report without a full build.
The habit of adding a whole-package `-keep` rule is a default reflex for SDK authors, but the new Play thresholds turn that convenience into a cross-SDK liability, because the rule's impact is only visible in the downstream app's build.
Google is effectively nudging the ecosystem toward R8 Full mode and precise keep rules; the analyzer and CLI tools make it possible to audit, but the burden falls on SDK maintainers to change their consumer rules.
The subsumed-rule detection is the subtle part: even if you refine your own rule, a broader rule from another dependency can silently nullify it, so fixing the problem requires identifying the source AAR or app config.