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 ?
- 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.
- 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
- 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 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
- Select your firebase project
- Select Android
- Open terminal inside your flutter project
cd android
./gradlew signingReport
orgradlew signingReport
- Paste your package name and your SHA1 key
- Download Client Information
- Download and replace the
google-services.json
flutter clean
For IOS:
- Select your Firebase project
- Select IOS
- Enter your Bundle ID
- Download credetials
- 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
- setState() or markNeedsBuild called during build A vertical renderflex overflowed
- Could not open settings generic class cache for settings file
- Exception in thread “main” java.lang.NoClassDefFoundError: javax/xml/bind/annotation/XmlSchema Flutter
- java.lang.IllegalArgumentException: Component class com.google.android.gms.wallet.ocr.CardRecognitionShimProxyActivity
- xcodebuild: WARNING: Using the first of multiple matching destinations