Skip to content

[google_sign_in_android] Keep default_web_client_id resource from being stripped by resource shrinker - #12075

Merged
auto-submit[bot] merged 3 commits into
flutter:mainfrom
gmackall:fix_188363
Jul 31, 2026
Merged

[google_sign_in_android] Keep default_web_client_id resource from being stripped by resource shrinker#12075
auto-submit[bot] merged 3 commits into
flutter:mainfrom
gmackall:fix_188363

Conversation

@gmackall

@gmackall gmackall commented Jun 30, 2026

Copy link
Copy Markdown
Member

Adds a keep rule for @string/default_web_client_id, which gets merged into the main app's keep rules during the build.

Fixes flutter/flutter#188363

Why this is needed

As documented in Customize which resources to keep:

You should rarely need to keep resources. The use of getIdentifier() is an exception; however, retrieving resources by identifier is more efficient than retrieving them by name with getIdentifier().

The plugin retrieves default_web_client_id dynamically via Resources.getIdentifier() in GoogleSignInPlugin.java:

int webClientIdIdentifier =
    context
        .getResources()
        .getIdentifier("default_web_client_id", "string", context.getPackageName());

Without this keep rule, Android's resource shrinker discards @string/default_web_client_id in release builds because there are no static bytecode references to the resource ID.

@gmackall
gmackall marked this pull request as ready for review July 30, 2026 19:28
@gmackall
gmackall requested review from a team, camsim99 and stuartmorgan-g and removed request for a team July 30, 2026 19:28

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request adds a keep.xml resource file to the Android implementation of the google_sign_in plugin to prevent the default_web_client_id resource from being stripped by resource shrinkers. It also updates the CHANGELOG.md and bumps the package version to 7.2.16 in pubspec.yaml. There are no review comments to address.

@camsim99 camsim99 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.

LGTM

@gmackall gmackall added the autosubmit Merge PR when tree becomes green via auto submit App label Jul 31, 2026
@auto-submit
auto-submit Bot merged commit a5beb57 into flutter:main Jul 31, 2026
13 checks passed
Subhanshu20135 pushed a commit to The-Developer-Diaries/flutter that referenced this pull request Aug 3, 2026
…r#190441)

flutter/packages@5351d8c...ac87e65

2026-07-31 developeryusuf@icloud.com [google_fonts] Remove failed loads
from pendingFonts (flutter/packages#12240)
2026-07-31 34871572+gmackall@users.noreply.github.com
[google_sign_in_android] Keep `default_web_client_id` resource from
being stripped by resource shrinker (flutter/packages#12075)
2026-07-31 brunocorona.alcantar@gmail.com [vector_graphics] Provide
textDirection for semantics label to avoid crash without Directionality
(flutter/packages#11962)
2026-07-31 43054281+camsim99@users.noreply.github.com
[camera_android_camerax] Update `AGENTS.md` to improve video recording
integration tests (flutter/packages#12301)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages-flutter-autoroll
Please CC flutter-ecosystem@google.com on the revert to ensure that a
human
is aware of the problem.

To file a bug in Flutter:
https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autosubmit Merge PR when tree becomes green via auto submit App CICD Run CI/CD p: google_sign_in platform-android

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[google_sign_in_android] Android release builds can strip default_web_client_id, causing GoogleSignInExceptionCode.clientConfigurationError

2 participants