0

I created and upload an app with google sign-in to google play, it works in debug mode and in release mode

I had to follow: Generate SHA-1 for Flutter app

and Google sign in failed com.google.android.gms.common.api.ApiException: 10:

Which says that I need to Link Google Play to Firebase https://support.google.com/firebase/answer/6392038?hl=en

But I get the following error:

enter image description here

Any idea how to solve this?

My app is in production but the login fails.

Elia Weiss
  • 8,324
  • 13
  • 70
  • 110

1 Answers1

0

My solution was:

  1. Login to Firebase console
  2. remove your android app
  3. add it again
  4. follow Generate SHA-1 for Flutter app to get your release sha-1 and add it to your app in Firebase console Google sign in failed com.google.android.gms.common.api.ApiException: 10:

remarks:

  1. I believe the actual value of the sha-1 key didn't changed
  2. I didn't add my debug SHA1, only release
  3. I believe simply deleting the debug SHA1 or deleting both and re-entering only the release SHA1 would have also solved the problem, but I didn't test it
  4. I still get the Linking to Google Play: An error occurred while trying to link but I doens't matter as long as the signing works
  5. I guess (didnt check yet) that now my app will fail on google singin indebugmode, but I will deal with it later - I hope that simply adding thedebug` key again will work

extra info (from firebase support)

Here we have two issues: Linking play console to Firebase console, and the issue with the google-sign-in on production.

For the linking problem, note that in order to link or unlink your Play Console account to a Firebase project, you need to use the same Google account on the Play Console and Firebase console. You may also check this https://support.google.com/googleplay/android-developer/answer/6110967?hl=en for more details, if the accounts are the correct try to enable Google Analytics first which then it will allow you to link your Google Play account.

For the second issue, you could have configured the debug and release SHA-1 keys. However, you need a third key hash, when you enroll for Google Play App Signing https://medium.com/mindorks/securing-and-optimizing-your-app-with-google-play-app-signing-24a3658fd319 in play console, you basically ask google to sign your app on your behalf, in order to obtain the key you must add the app signing certificate from the Play console, and add the SHA-1 key in the Firebase console. I really encourage you to read this blog entry https://medium.com/@akashmahali/facebook-login-google-sign-in-not-working-on-android-app-in-production-5febd9537f92, there the author explains more about this error, and how to fix it.

If you have any questions, feel free to write back !

Elia Weiss
  • 8,324
  • 13
  • 70
  • 110