Skip to content

Shrink the Android app with R8 - #139

Merged
mLampir merged 1 commit into
mainfrom
claude/project-thread-gzy6ts
Oct 23, 2026
Merged

mLampir merged 1 commit into
mainfrom
claude/project-thread-gzy6ts

Conversation

@mLampir

@mLampir mLampir commented Oct 23, 2026

Copy link
Copy Markdown
Owner

Requested by Michael · project thread

Google Play showed three warnings for 1.0.1. This PR acts on one of them.

R8 (changed)

  • Release builds now use minifyEnabled true, shrinkResources true and proguard-android-optimize.txt.
  • Capacitor's consumer rules (capacitor-android/proguard-rules.pro) keep every Plugin subclass 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,LineNumberTable keeps line numbers. AGP puts the mapping file into the AAB, so Play deobfuscates crash reports on its own.
  • Not built locally: there was no Android SDK in this environment. A missing-class error would fail the Codemagic build where it shows up, not silently. Runtime check: install the build from the internal test track and try notifications, "use my location", haptics, and the backup.

Edge-to-edge (no change)

Capacitor 8's SystemBars (insetsHandling: css) already handles the insets. pet.html uses viewport-fit=cover and reads --safe-area-inset-* / env(). Android 15+ draws edge to edge, and older versions keep normal bars. Both work. Calling EdgeToEdge.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

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
@mLampir mLampir self-assigned this Oct 23, 2026
@mLampir
mLampir merged commit 9d196ee into main Oct 23, 2026
5 checks passed
@mLampir
mLampir deleted the claude/project-thread-gzy6ts branch October 23, 2026 15:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants