Google Sign in not working from app downloaded from playstore

Yesterday same problem occurred to me.

Google has released a new signing service in playstore publish console in which google will signin your app with his keystore. After signing , it will give you a new SHA which you have to add in your fireenter image description herebase account. See the image for the better understanding


You added sha-1 key for your app in debug mode and at that time you will be able to do google sign in your app. But as the app goes in production, it requires sha-1 key for production. And that you need to add at firebase console. You can check your firebase console and check for android app.

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android 

The above commad helps to create sha-1 key for debug version.

You meed to provide you signed key-store file path for production sha-1. And this will be done with command

keytool -exportcert -list -v \-alias <your-key-name> -keystore <path-to-production-keystore>

You just need to provide specific paths for keystore file for released apk.


It is very simple, Go to play store account where you uploaded your signed APK. select your App, then go to the Release Management section then App signing.

Copy the SHA1 key of App Signing certificate.

Go to this link https://developers.google.com/identity/sign-in/android/start-integrating

Click on CONFIGURE A PROJECT button

select your App, select Android, App your app package name, then paste the SHA1 certificate

Then click Create. Thats it.

Now you can use google signin in your App


Solution:

  • The problem was that while generating the google-services.json, the App signing certificate SHA-1 certificate fingerprint needs to be provided; I was providing the Upload certificate's SHA-1 certificate fingerprint which is why it wouldn't work on production.
  • In essence, in the credentials page, you'll need to create a two oauth client ids for Android (one with the App Signing certificate and one with the Upload certificate and one oauth client id of type web and in while using react-native-google-signin you need to specify the webClientId.