Flutter: com.google.android.gms.common.api.ApiException: 12500

When you add sign-in from the 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 appear when you change your system (laptop/computer).

Let’s fix this problem.

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)

The exception code is sign_in_failed.

The exception value is com.google.android.gms.common.api.ApiException: 12500:

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 Project Settings in Firebase

Go to the Public settings section

Add the support email address

Change Support Email in Firebase

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 the Project settings

User Permission inside play store console

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.

Emulators List without Play Store Service

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 the 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 will see the apps 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

SHA-1 certificate fingerprint (Add option) in firebase

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 to 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 the version and add it to the firebase settings.

Most Importantly download the latest version of google-service.json from the firebase.

And place it inside the android project app folder.

Place Google Service json file inside Android 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.

Configure Google Cloud Auth Consent Scree

Fill up all the required fields.

And save.

If you place your SHA-1 Key in the “firestore” and 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.

Check Google Sign in method in enabled in firebase authentication

Again Clean and run the flutter app you will see that the 12500 Error solved.

Conclusion

Hopefully by following the above solutions your sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: the issue will be resolved.

Thanks for reading!

Hussain Humdani

Hussain Humdani

while ( ! ( succeed = try() ) );