When you add sign-in from google feature in your android (flutter/ react-native / ionic) app. You will probably face this exception error 12500
.
Most of the time you miss some settings in your firebase or google cloud. But sometimes errors show up when you change your system (laptop/computer).
Let’s fix the flutter Google Sign in Plugin 12500 Error
.
When you run the app at the debug console you will see a message.
Local module descriptor class for com.google.android.gms.auth.api.fallback not found.
Exception detail:
PlatformException(sign_in_failed,
com.google.android.gms.common.api.ApiException: 12500: ,
null, null)
Exception code is sign_in_failed
Exception value is: com.google.android.gms.common.api.ApiException: 12500:
In this Article
Solution 1 – Add support mail to Firebase Project
If you are using firebase inside your project, please make sure you have added the support email.
Go to the Project Settings
Go to the Public settings section
Add the support email address
Change Support Email in Firebase
Let’s see how you can change the support email of the firebase project. You can select any admin mail from the dropdown. For a new email
Go to the Users and Permissions section in Project settings
Add a member from here
Member email will be shown on the dropdown then select it.
Maybe you don’t want to share your email here and you have to remove 12500 errors
.
For that, you can create a google group and create emails for that group. That email will also show here so you can select it.
You just change the mail but you still have this error. Let’s solve the 12500 Exception
with this solution.
Solution 2 – Have an Emulator with Play Store support
You are using an android emulator to test your flutter app. Most emulators available at android studio avd manager don’t have Play Store support.
Please check your emulator. Does it support the play store? If Yes then you are good to go because most of the time we get
com.google.android.gms.common.api.ApiException: 12500:
Error when our emulator did not have Play Store support.
Please, Install a new emulator with play store support.
Run your flutter app.
Did your error go away?
If not yet consider this solution
Solution 3 – Add SHA1 Key
to Your Project
You need to add SHA1 Key inside firebase Project OR Google Cloud Credentials.
How to add SHA1 Key android signing in Firebase
Open Firebase
Go to Project Settings
Move to the bottom section where you see the apps that you have configured. If not then Configure your flutter app with firebase first.
Now, you see your android apps here.
You can see the field of SHA certificate fingerprints
Here you place the generated SHA-1 code
Now the question is How to SHA certificate fingerprints for our android app
Let’s see the app signing process
Go your flutter terminal inside your project and type
cd android
Now execute
./gradlew signingReport
You can see certificates of Gradle singingReport
Use the SHA-1
code from the first section debug version and add it to the firebase settings.
Most Importantly download the latest version of google-service.json
from the firebase.
And place it up inside the android project app folder.
Save firebase
Now with this method, your Error 10
will also be removed.
Now!
Run flutter clean
Then flutter pub get
Again build the project. And check the error status. Hopefully, Error 12500
will be removed.
Solution 4 – Setup Google Cloud OAuth Consent Screen
Check your google cloud console that the OAuth consent screen is configured or not.
Fill up all the required fields.
And save.
If you place your SHA-1 Key
in the “firestore” then your cloud credentials are automatically generated. We don’t need to especially create one.
Again build the project
Your error com.google.android.gms.common.api.ApiException: 12500:
should be resolved.
Solution 5 – Enable Google Sign Method inside firebase Authentication
If you are using firebase authentication somehow. Then please check the Sing-in Method Google is enabled.
Again Clean and run the flutter app you will see that 12500 Error
solved
Conclusion
Hopefully by following the above solutions your sign_in_failed, com.google.android.gms.common.api.ApiException: 12500:
issue will be resolved. Thanks for reading