[firebase_core]: When using flavors in Android <Unhandled Exception: PlatformException(java.lang.Exception: Failed to load FirebaseOptions> #12802
Labels
blocked: customer-response
Waiting for customer response, e.g. more information was requested.
platform: android
Issues / PRs which are specifically for Android.
plugin: core
Stale
Issue with no recent activity
type: bug
Something isn't working
Is there an existing issue for this?
Which plugins are affected?
Core
Which platforms are affected?
Android
Description
The issue is the same happening in this issue, which is closed by proposing a workaround, but the root cause of the problem is not fixed.
After updating Gradle to the new declarative API, the issue started. In my specific case, I am using Flavors, each flavors has it's own
google-services.json
. Before, when using the previous imperative Gradle API this issue was not happening.Reproducing the issue
dev
andprod
id "com.google.gms.google-services" version "4.4.0" apply false
id "com.google.gms.google-services"
main()
function to initialize Firebase.Firebase Core version
2.31.0
Flutter Version
3.22.0
Relevant Log Output
Additional context and comments
I created a minimal project that you can use to reproduce the problem. https://github.com/Yayo-Arellano/firebase_options_test
Just run the dev or prod flavor and you will see the crash:
flutter run --flavor dev
or
flutter run --flavor prod
The text was updated successfully, but these errors were encountered: