Skip to content

fix(android): suppress R8 missing-class errors for Play Core split-install; run minification in CI - #256

Merged
richardthe3rd merged 1 commit into
mainfrom
copilot/fix-proguard-r8-configuration
May 11, 2026
Merged

fix(android): suppress R8 missing-class errors for Play Core split-install; run minification in CI#256
richardthe3rd merged 1 commit into
mainfrom
copilot/fix-proguard-r8-configuration

Conversation

Copilot AI commented May 11, 2026

Copy link
Copy Markdown
Contributor

Flutter's embedding unconditionally references com.google.android.play.core split-install classes (PlayStoreDeferredComponentManager, FlutterPlayStoreSplitApplication, etc.) regardless of whether the app uses deferred components. R8 treats any unresolvable referenced class as a hard error, breaking the release build.

The CI build-android job was using --debug, which skips R8 entirely — so this only surfaced at release time.

Changes

  • android/app/proguard-rules.pro — add -dontwarn for the three missing Play Core packages:

    -dontwarn com.google.android.play.core.splitcompat.**
    -dontwarn com.google.android.play.core.splitinstall.**
    -dontwarn com.google.android.play.core.tasks.**
    

    Safe to suppress: the referencing code paths are dead for apps without dynamic feature modules.

  • .github/workflows/ci.yml — switch build-android from flutter build apk --debug to --release. key.properties is absent in this job, so build.gradle falls back to debug signing automatically — but R8 now runs on every PR, catching minification failures before release.

@richardthe3rd
richardthe3rd marked this pull request as ready for review May 11, 2026 18:06
Copilot AI review requested due to automatic review settings May 11, 2026 18:06

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses Android release build failures caused by R8 treating Flutter’s deferred-component (Play Core split-install) references as missing-class errors, and updates CI to run minification on every PR by building the Android APK in --release mode.

Changes:

  • Suppress R8 missing-class warnings/errors for Play Core split-install packages via -dontwarn rules.
  • Switch the CI Android build from flutter build apk --debug to --release and update the uploaded artifact name/path accordingly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
android/app/proguard-rules.pro Adds -dontwarn rules for Play Core split-install packages to prevent R8 missing-class failures in release builds.
.github/workflows/ci.yml Builds a release APK in CI (debug-signed) to ensure R8/minification runs on PRs; updates artifact name and output path.

Comment thread .github/workflows/ci.yml
name: app-release-apk
path: build/app/outputs/flutter-apk/app-release.apk
if-no-files-found: error


# Flutter references Play Core split-install classes for deferred component support.
# This app does not use dynamic feature modules, so these classes are absent at
# compile time. Suppress the missing-class errors R8 raises for them.
@github-actions

Copy link
Copy Markdown
Contributor

LCOV of commit c5cbf01 during CI #151

Summary coverage rate:
  lines......: 77.1% (2439 of 3163 lines)
  functions..: no data found
  branches...: no data found

Files changed coverage rate: n/a

@codecov

codecov Bot commented May 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@github-actions

Copy link
Copy Markdown
Contributor

🚀 Cloudflare Pages Preview

Your preview deployment is ready!

Preview URL: https://copilot-fix-proguard-r8-conf.staging-cambeerfestival.pages.dev

This preview will be automatically updated when you push new commits to this PR.

@richardthe3rd
richardthe3rd merged commit 741dd7c into main May 11, 2026
15 checks passed
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.

3 participants