I developed a app with Flutter and tested on my device using the command:
flutter run --release
and everything worked fine. I also tried building the app with:
flutter build apk --release
and installing it manually, and still everything was ok.
I uploaded on the store, and now the login doesn't work anymore. I tried looking at the logcat and the error i get when i try to login is:
I/flutter: exception: PlatformException(sign_in_failed, com.google.android.gms.common.api.ApiException: 12500: , null)
I tried adding the appCompat dependency and I checked the the SHA1 keys, everything is in the right place, I can't figure out why when I download if from the store it doesn't work anymore.
Step 1: First create the flutter project in your IDE. Step 2: After that just remove the default code and start from scratch. Step 3: Now just import the material library and call the runApp( ) function into the main function name as GoogleSignIn. Step 4: Now make a stateful widget with the name 'GoogleSignIn'.
To compile in release mode, we just need to add the --release flag to the flutter run command and have a physical device connected. Although we can do so, we typically do not use the flutter run command with the --release flag.
You likely have to register your Play Store app signing key with API providers (in this case Firebase).
In your Google Play Console, visit Setup > App signing
Copy SHA-1 certificate fingerprint
In your Firebase Console, visit Settings > Project settings
Click Add fingerprint
Paste copied SHA-1 certificate fingerprint
into Certificate fingerprint
textfield
Click Save
Your app probably does not have the correct Google credentials for the Token API.
When you first signed up on the Google Play Console, you probably opted into Google's app signing service. What this does is, after you sign your app with your keystore and upload it to the Play Console, Google will actually sign your app with a generated keystore and roll that version out. You can access the keys with which the release version is signed from the console, under Release Management -> App signing -> App signing certificate.
Once you locate the certificate, you need to use the SHA1 key, and generate a new Android Oauth Credential, and then add that to your google-services.json. If you are not using Firebase, you will have to add the Oauth credential to your backend as well.
If you look at HarshitG's answer on this Android thread concerning the same issue, you can see a picture of where you can get the certificate information on the Play Console.
google signIn not working in release mode apk android
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