You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Feature Request: Support configuring ProGuard/R8 in buildozer/p4a to meet Google Play DEX code optimization requirements #3412
Google Play Console now enforces an Android Vitals requirement for DEX code optimization (specifically mandating at least a 25% obfuscation/optimization score for apps with significant DEX code sizes).
Because Kivy and python-for-android bundle the Python runtime and standard Java bootstrap classes in an un-obfuscated state, release app bundles (.aab) generated via buildozer/p4a currently score around 1% obfuscation, triggering warnings or publishing restrictions in the Play Console.
While developers can attempt manual workarounds, a native or officially documented way to integrate R8 minification and baseline ProGuard rules within python-for-android/buildozer builds would help Kivy apps comply with modern Google Play standards.
Current Behavior
Release builds (.aab) built with buildozer/p4a lack code obfuscation/optimization.
Google Play Console flags the app under Android Vitals > DEX code optimization with scores under 25% (e.g., 1%).
Desired Behavior
Provide built-in support, documentation, or a standard mechanism in p4a/buildozer to enable R8 shrinking/obfuscation safely for release builds.
Supply or recommend default proguard-rules.pro that preserve essential Kivy, SDL2, and Python-for-Android JNI bridge classes so that minification doesn't cause runtime crashes.
Proposed Solution / Workaround (Optional)
Exposing a flag in buildozer.spec (e.g., android.minify = True) or allowing custom ProGuard rule integration would allow developers to easily satisfy Play Store requirements.
According to Google's official documentation on Android Vitals Code Optimization, developers must utilize code shrinkers like R8 and ensure proper metadata packaging. Furthermore, using modern tooling like the Android CLI and Agent Tools or local builds tested via the Android Performance Analyzer downloads helps track these metrics. However, python-for-android currently lacks native integration or documented pathways to apply R8 safely without breaking the dynamic Python JNI bridge.
Activity