Repository navigation
Shrink the Android app with R8 - #139
Merged
Merged
Conversation
Google Play warns that the app is not optimized. Turn on R8 and resource shrinking for release builds; Capacitor's consumer rules keep the plugin classes the bridge finds by reflection. Keep line numbers so the crash reports in Play stay readable with the mapping file from the bundle. Note why the portrait lock stays, which Play also warns about. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WABuqaLUF7uP6mJEEswTJp
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.
Requested by Michael · project thread
Google Play showed three warnings for 1.0.1. This PR acts on one of them.
R8 (changed)
minifyEnabled true,shrinkResources trueandproguard-android-optimize.txt.capacitor-android/proguard-rules.pro) keep everyPluginsubclass and its annotated methods, which the bridge finds by reflection. Activities, receivers and providers from the manifests are kept by AAPT as usual.-keepattributes SourceFile,LineNumberTablekeeps line numbers. AGP puts the mapping file into the AAB, so Play deobfuscates crash reports on its own.Edge-to-edge (no change)
Capacitor 8's
SystemBars(insetsHandling: css) already handles the insets.pet.htmlusesviewport-fit=coverand reads--safe-area-inset-*/env(). Android 15+ draws edge to edge, and older versions keep normal bars. Both work. CallingEdgeToEdge.enable()on top of that would add a second inset owner, which is what caused keyboard and inset bugs in HeartNotes.Portrait lock (no change, comment added)
On a phone held sideways the scene and both bar rows don't fit. With targetSdk 36, Android 16 already ignores the lock on large screens (sw ≥ 600dp). In a 1280×800 browser check the page stands as a centered column and works. The manifest now says why the lock stays.
Generated by Claude Code