Menu

1 / 2

Google Play DEX Code Optimization in Capacitor Apps

DEV Community: ionic·Robin·5 days ago
#cotSigJG
#devtoionic#devto#dev#android#capacitor
Reading 0:00
15s threshold

If Play Console shows a "DEX code optimization" finding for your Capacitor app, the Android project template is the cause. From February 2027, Google Play requires at least 25% obfuscation, optimization and shrinking for every app with more than 10 MB of DEX code, and the Capacitor Android template ships with R8 turned off. In this post, we walk through the fix: two lines in build.gradle , a short proguard-rules.pro , and one check before you upload.

Prerequisites

You'll need:

A Capacitor 8 Android app

Android Gradle Plugin (AGP) 8.x

Everything below comes from our own production app at Capawesome, which uses about 40 plugins and runs on Capacitor 8.5.0 with AGP 8.13.2.

Play's DEX optimization requirement

Google Play measures three percentages for every app bundle you upload: obfuscation, optimization and shrinking. A Capacitor app built from the default template scores close to zero on all three.…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.