Reputation: 11
When I try to build a project locally in Android Studio, the login fails.
The error that occurs is:_LoginScreenState._onSignInWithGoogle: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 10: , null, null)
Upvotes: 1
Views: 28
Reputation: 312
Fingerprints and keystores are a very important concept in Android to understand. Let's break this down. I recommend you read through this App Signing page to better understand how this all works.
When we develop our application locally, Android Studio provides a unique keystore for debug builds. This has its own fingerprint that must be tracked.
Then when we build release builds of Android we must provide a release keystore that also has a separate fingerprint. That must be tracked for local development, otherwise Google Signin will reject auth attempts.
Finally, when we release builds to Google Play, there is another keystore that Google maintains and re-signs your app with. This fingerprint must also be specified to Google SignIn. More information can be found here.
Regenerating your keystore will not solve this issue.
To understand what fingerprints are being used by your local debug and release keystore, you can run this command in theandroid
directory of your flutter app. ./gradlew signingreport
. This will output all the fingerprints which you must register with Google Signin.
Upvotes: 0