[google_sign_in_android] Keep `default_web_client_id` resource from being stripped by resource shrinker (#12075) Adds a keep rule for `@string/default_web_client_id`, which gets merged into the main app's keep rules during the build. Fixes https://github.com/flutter/flutter/issues/188363 ### Why this is needed As documented in [Customize which resources to keep](https://developer.android.com/topic/performance/app-optimization/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`](https://github.com/flutter/packages/blob/main/packages/google_sign_in/google_sign_in_android/android/src/main/java/io/flutter/plugins/googlesignin/GoogleSignInPlugin.java#L201-L204): ```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.
This repo is a companion repo to the main flutter repo. It contains the source code for Flutter's first-party packages (i.e., packages developed by the core Flutter team). Check the packages directory to see all packages.
These packages are also available on pub.
Please file any issues, bugs, or feature requests in the main flutter repo. Issues pertaining to this repository are labeled “package”.
If you wish to contribute a new package to the Flutter ecosystem, please see the documentation for developing packages. You can store your package source code in any GitHub repository (the present repo is only intended for packages developed by the core Flutter team). Once your package is ready you can publish to the pub repository.
If you wish to contribute a change to any of the existing packages in this repo, please review our contribution guide, and send a pull request.
These are the packages hosted in this repository: