close

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

Hello Guys, How are you all? Hope You all Are Fine. Today I am trying to use flutter google sign in plugin But I am facing following error PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) in flutter. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

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

I am trying to use flutter google sign in plugin But I am facing following error.

E/flutter ( 5068): [ERROR:flutter/shell/common/shell.cc(184)] Dart Error: Unhandled exception:
E/flutter ( 5068): PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null)
E/flutter ( 5068): #0      StandardMethodCodec.decodeEnvelope (package:flutter/src/services/message_codecs.dart:551:7)
E/flutter ( 5068): #1      MethodChannel.invokeMethod (package:flutter/src/services/platform_channel.dart:292:18)
E/flutter ( 5068): <asynchronous suspension>

How To Solve PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) Error ?

  1. How To Solve PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) Error ?

    To Solve PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) Error Generate SHA1 and SHA256 keys. Add both the SHA1 and SHA256 to firebase. (in you app settings) Download google-services.json to android/app in your project folder. In your terminal run the command flutter clean . Run your flutter app. Now your error must be solved.

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

    To Solve PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null) Error Generate SHA1 and SHA256 keys. Add both the SHA1 and SHA256 to firebase. (in you app settings) Download google-services.json to android/app in your project folder. In your terminal run the command flutter clean . Run your flutter app. Now your error must be solved.

Solution 1: Generate SHA1 and SHA256 keys

  1. Generate SHA1 and SHA256 keys.
  2. Add both the SHA1 and SHA256 to firebase. (in you app settings)
  3. Download google-services.json to android/app in your project folder.
  4. In your terminal run the command flutter clean .
  5. Run your flutter app.
  6. Now your error must be solved.

Solution 2 : Generating a debug.keystore and registering it inside the app on Firebase

This Error Must be Because of you did not register a SHA fingerprint in firebase. Without  register a SHA fingerprint in firebase you cant use Google’s API.

I solved it by generating a debug.keystore and registering it inside the app on Firebase. Don’t forget to download the new google-services.json after that.

To Generate certificate fingerprint Follow below command in your windows terminal.

keytool -exportcert -list -v \ -alias <your-key-name> -keystore <path-to-production-keystore>

Output will be like below

The signing report will include the signing information for each of your app’s variants:

> Task :app:signingReport
Variant: debug
Config: debug
Store: ~/.android/debug.keystore
Alias: AndroidDebugKey
MD5: A5:88:41:04:8D:06:71:6D:FE:33:76:87:AC:AD:19:23
SHA1: A7:89:E5:05:C8:17:A1:22:EA:90:6E:A6:EA:A3:D4:8B:3A:30:AB:18
SHA-256: 05:A2:2C:35:EE:F2:51:23:72:4D:72:67:A5:6C:8C:58:22:2A:00:D6:DB:F6:45:D5:C1:82:D2:80:A4:69:A8:FE
Valid until: Wednesday, August 10, 2044

Just add SHA in your firebase project and then dont forgot to download new google-services.json after that.

Also Read This Google’s Official Method to Authenticating Your Client.

Solution 3: Download and replace the google-services.json file

Make sure to be logged in with the same account of Firebase

For Android

  1. Select your firebase project
  2. Select Android
  3. Open terminal inside your flutter project
  4. cd android
  5. ./gradlew signingReport or gradlew signingReport
  6. Paste your package name and your SHA1 key
  7. Download Client Information
  8. Download and replace the google-services.json
  9. flutter clean

For IOS:

  1. Select your Firebase project
  2. Select IOS
  3. Enter your Bundle ID
  4. Download credetials
  5. Download and replace GoogleService-info.plist

Summary

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you?

Also, Read

Leave a Comment

%d bloggers like this: