I use Firebase authentication with google_sign_in for my CrossPlatform Mobile app that's been developed with Flutter framework.
The problem :
Platformexception(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
Notes :
What I've tried so far :
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false
shrinkResources false
}
}
I know this error is most likely relatd to SHA keys, so if somebody could explain which SHA1 & SHA256 Keys should be added and exactly how should I generate them, that would be nice also, just to exclude that possibility completely. Also I'd be grateful for any other insights.
Google uses Automatic App Signing by default, which means that your SHA-key will change after you upload to Google Play.
To find the new key, go to the Play console > Setup > App Integrity > App Signing (or click on this link: https://play.google.com/console/developers/app/keymanagement).
You will find three keys there: MD5, SHA-1 and SHA-256.
Now you just have to add those keys in the Firebase console under Project settings > General.
With iOS, you don't need to care about adding sha key
With Android, I think mostly you've missed adding sha app signing key
When you run your project (both debug & release mode), this behavior is the same you install an APK to the device, and local keystore (also called upload keystore - the key you generated by yourself) is fine in this case
But when you install your app from Google Play (or internal testing or whatever through Google Play), google uses app signing key to sign your app (not your upload keystore) like image below, so miss adding this sha key will cause the error

-> Solution: find your app signing key on the dashboard like the image below and add it to your config

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With