firebase / flutterfire

🔥 A collection of Firebase plugins for Flutter apps.
https://firebase.google.com/docs/flutter/setup
BSD 3-Clause "New" or "Revised" License
8.63k stars 3.95k forks source link

🐛 [auth] + [google_sign_in] : PlatformException: 12500 #11175

Closed jimmyff closed 1 year ago

jimmyff commented 1 year ago

After deleting an Android app from my Firebase projects settings then re-adding it (in an attempt to fix Google Sign In ApiException 12500 error) my app is now failing to connect to Firebase at all.

I'm getting:

Failed to get FIS auth token ``` E/FirebaseInstanceId(24277): Failed to get FIS auth token E/FirebaseInstanceId(24277): java.util.concurrent.ExecutionException: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later. E/FirebaseInstanceId(24277): at com.google.android.gms.tasks.Tasks.zza(com.google.android.gms:play-services-tasks@@18.0.2:5) E/FirebaseInstanceId(24277): at com.google.android.gms.tasks.Tasks.await(com.google.android.gms:play-services-tasks@@18.0.2:8) E/FirebaseInstanceId(24277): at com.google.firebase.iid.GmsRpc.setDefaultAttributesToBundle(com.google.firebase:firebase-iid@@21.1.0:11) E/FirebaseInstanceId(24277): at com.google.firebase.iid.GmsRpc.startRpc(com.google.firebase:firebase-iid@@21.1.0:1) E/FirebaseInstanceId(24277): at com.google.firebase.iid.GmsRpc.getToken(com.google.firebase:firebase-iid@@21.1.0:1) E/FirebaseInstanceId(24277): at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$2$FirebaseInstanceId(com.google.firebase:firebase-iid@@21.1.0:1) E/FirebaseInstanceId(24277): at com.google.firebase.iid.FirebaseInstanceId$$Lambda$3.start(Unknown Source:10) E/FirebaseInstanceId(24277): at com.google.firebase.iid.RequestDeduplicator.getOrStartGetTokenRequest(com.google.firebase:firebase-iid@@21.1.0:7) E/FirebaseInstanceId(24277): at com.google.firebase.iid.FirebaseInstanceId.lambda$getInstanceId$3$FirebaseInstanceId(com.google.firebase:firebase-iid@@21.1.0:5) E/FirebaseInstanceId(24277): at com.google.firebase.iid.FirebaseInstanceId$$Lambda$0.then(Unknown Source:6) E/FirebaseInstanceId(24277): at com.google.android.gms.tasks.zze.run(com.google.android.gms:play-services-tasks@@18.0.2:1) E/FirebaseInstanceId(24277): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/FirebaseInstanceId(24277): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/FirebaseInstanceId(24277): at h3.c.run(com.google.android.gms:play-services-basement@@18.2.0:2) E/FirebaseInstanceId(24277): at java.lang.Thread.run(Thread.java:923) E/FirebaseInstanceId(24277): Caused by: com.google.firebase.installations.FirebaseInstallationsException: Firebase Installations Service is unavailable. Please try again later. E/FirebaseInstanceId(24277): at com.google.firebase.installations.remote.FirebaseInstallationServiceClient.createFirebaseInstallation(FirebaseInstallationServiceClient.java:153) E/FirebaseInstanceId(24277): at com.google.firebase.installations.FirebaseInstallations.registerFidWithServer(FirebaseInstallations.java:533) E/FirebaseInstanceId(24277): at com.google.firebase.installations.FirebaseInstallations.doNetworkCallIfNecessary(FirebaseInstallations.java:387) E/FirebaseInstanceId(24277): at com.google.firebase.installations.FirebaseInstallations.lambda$doRegistrationOrRefresh$3(FirebaseInstallations.java:372) E/FirebaseInstanceId(24277): at com.google.firebase.installations.FirebaseInstallations.c(Unknown Source:0) E/FirebaseInstanceId(24277): at com.google.firebase.installations.c.run(Unknown Source:4) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.SequentialExecutor$1.run(SequentialExecutor.java:117) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.workOnQueue(SequentialExecutor.java:229) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.SequentialExecutor$QueueWorker.run(SequentialExecutor.java:174) E/FirebaseInstanceId(24277): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167) E/FirebaseInstanceId(24277): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.CustomThreadFactory.lambda$newThread$0(CustomThreadFactory.java:47) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.CustomThreadFactory.a(Unknown Source:0) E/FirebaseInstanceId(24277): at com.google.firebase.concurrent.a.run(Unknown Source:4) E/FirebaseInstanceId(24277): ... 1 more ```

Why did I delete the Android app in Firebase?

I've been trying to get Google Sign in working on a Flutter app for 2 weeks (not exaggerating!). I've implemented Google Sign In numerous times however this implementation is a little more complex: The app that is failing to work is a 'flavor' of an existing app that has a working google sign in, it shares the same Firebase project as the original app. This app is also replacing a production app in Google Play so there are some GCP resources associated with it. I've contacted the Firebase team directly about it as I was convinced the problem is a bug, but I got some unhelpful templated responses about 'getting started with google sign'.

The confusing part is that I created 2 flavors (so 3 apps in total), and the second flavor app is working (and now live in Google Play). Both flavors were setup and configured simultaneously and almost identically. Yet one of the flavors is failing to work. It has been giving me ApiException 12500 for 2 weeks and I've tried everything, checked everything tens of times, so today I decided I would delete the Android app from the Firebase project and set it up again, hoping this might rectify the problem.

What have I have previously done to try to rectify the 12500 API error


Flutter doctor ``` [✓] Flutter (Channel stable, 3.10.3, on macOS 12.6.2 21G320 darwin-arm64, locale en-GB) • Flutter version 3.10.3 on channel stable at /Users/jimmyff/sdks/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision f92f44110e (3 weeks ago), 2023-06-01 18:17:33 -0500 • Engine revision 2a3401c9bb • Dart version 3.0.3 • DevTools version 2.23.1 [✓] Android toolchain - develop for Android devices (Android SDK version 33.0.0) • Android SDK at /Users/jimmyff/Library/Android/sdk • Platform android-33, build-tools 33.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) • All Android licenses accepted. [✓] Xcode - develop for iOS and macOS (Xcode 14.2) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 14C18 • CocoaPods version 1.12.1 [✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome [✓] Android Studio (version 2022.2) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b802.4-9586694) [✓] VS Code (version 1.79.0) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.66.0 [✓] Connected device (4 available) • Pixel 3 (mobile) • 8B6X14E12 • android-arm64 • Android 11 (API 30) • sdk gphone64 arm64 (mobile) • emulator-5554 • android-arm64 • Android 13 (API 33) (emulator) • macOS (desktop) • macos • darwin-arm64 • macOS 12.6.2 21G320 darwin-arm64 • Chrome (web) • chrome • web-javascript • Google Chrome 114.0.5735.133 [✓] Network resources • All expected network resources are available. • No issues found! ```

So at the moment the app won't work at all as Firebase is failing to initialise, I think I may have run in to a genuine firebase issue here? (I've re-downloaded the new google-services, done flutter cleans etc)

Any help would be really really appreciated!

Thanks

jimmyff commented 1 year ago

I've solved the Failed to get FIS auth token issue: I noticed in my new google-services file included x2 api_key values (for some reason firebase and included an additional one). Checking GCP: the one it had added is an API restricted key used for Google Maps (and doesn't include Firebase Installations API, etc) so I don't think it should be in google_services. Removing the mentioned of the new key has now got Firebase initalising again. However I'm now I'm back to square 1 with my old nemesis: ApiException 12500. I've now tried everything, including deleting it all and setting it back up!

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null, null)
darshankawar commented 1 year ago

@jimmyff Can you check this and see if it helps in your case ?

google-oss-bot commented 1 year ago

Hey @jimmyff. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot commented 1 year ago

Since there haven't been any recent updates here, I am going to close this issue.

@jimmyff if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.