PlatformException(sign_in_failed, com.google.android.gms.common.api...: 10: , null, null)

Created At: 2023-06-02 00:06:20 Updated At: 2023-10-25 00:31:43

When you try to use Google login or logout your Flutter app, you may get the error below

PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)

or 

No acceptable module com.google.android.gms.providerinstaller.dynamite found. 

Based on my experience and experiment, there could be at least five reasons that you got this error. But first of all you need to make sure, you have a Firebase project ready. You may need to check with the below five options one by one. 

Tutorial Index

Enable Google Login

Google Service json file

SHA1 & SHA256 Fingerprint

Internet Access Permission

Google Play Store

Enable Google Login

If you are using Firebase for Google login and authentication, you have to register you app, with firebase. For registering, you need to create firebase projects and apps. 

You need to enable Google login or login provider in the firebase console. Otherwise you won't be able to login.

So the steps are

  1. Click on Authentication menu like on the picture
  2. Then click on Sign in method
  3. And then add new provider as Google sign in

Google Service json file

Make sure you have firebase app for Android and iOS. Once you create the project, you have to download the GoogleService-Info.plist for iOS and google-services.json for Android.

Make sure that, you have them ready in correct place. For iOS GoogleService-Info.plist should be inside 

For Android make sure you have the file in below location

SHA1 & SHA256 Fingerprint

You need to create SHA1 & SHA256 fingerprint key for you app. To do it, follow the steps

1. You need to make sure you have Java Key Tool installed in your machine. 

2. Generate SHA1 & SHA256 fingerprint key for you app. From the given link, generate the key and put as in the below picture shown.

Make sure that you choose your Android app and put in the place of SHA-1 and SHA-256 key. Make sure them you can the correctly copied key from the console. If you put white space or extra characters it won't work.

Internet access permission

Here also check your android/app/src/main/AndroidManifest.xml file and add the permission below

 <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

  If you don't add the above permission, you may get the below error

W/ProviderInstaller(14159): Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0 FIAM.Headless(14159): Successfully fetched 0 messages from backend

Google Play Store

You need to make sure in your emulator you have Google play store installed. Otherwise you won't be able to login with Google service.

The above four steps if you do correctly, you won't have any problem. If first time, did not work make sure to delete the app from emulator and redo again.

Complete Firebase App

Comment

Add Reviews