Repository navigation
Turn on R8 minify and resource shrinking for Android release builds - #117
Merged
Merged
Conversation
Play Console flags the release for DEX code optimisation/obfuscation below its threshold. expo-build-properties now sets enableMinifyInReleaseBuilds and enableShrinkResourcesInReleaseBuilds; keep rules go in android.extraProguardRules.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What / why
Play Console flags release 19 (2.0.0): "DEX code optimisation is below our threshold, Obfuscation (1%)", fix by Feb 2027. The generated
android/app/build.gradledefaultsandroid.enableMinifyInReleaseBuildsto false and app.json never set it, so release builds shipped unshrunk, unobfuscated bytecode.app.json:expo-build-properties>androidgainsenableMinifyInReleaseBuildsandenableShrinkResourcesInReleaseBuilds.plugins/build-properties.test.ts: asserts both.CLAUDE.md: gotcha line (R8 is on; release-only ClassNotFound/NoSuchMethod gets a keep rule inextraProguardRules, never turn minify off; mapping ships in the AAB).Android only. iOS has no equivalent requirement; the JS bundle is Hermes bytecode and unaffected.
Note: the Expo template uses
proguard-android.txt(-dontoptimize), so R8 shrinks and renames but does not optimise. Play only flags the Obfuscation category, which renaming fixes; switching to the optimize profile is a possible follow-up.Verification
Gate green (tsc, lint, format, jest 409 suites / 4949 tests).
Live on a Pixel 6a, release APK built from this branch (side-by-side
app.audiosilo.dev):minifyReleaseWithR8, 95.5% of classes renamed; APK 50.9 MB vs 63.8 MB unminified (about 20% smaller).Pairs with KodeStar/audiosilo-docs (fix/android-r8-minify).