A non-recoverable sign in failure occurred Google Sigin

6.2k Views Asked by At

I'm trying to use react-native-google-signin in a new project. I'm trying by hours, to solve this issue and I see all topics, threads and issues about it and nothing solve my problem. The error is: A non-recoverable sign in failure occurred

  • I, created the project in Google Console
  • I created the consent screen (and interestingly its status is "not published", would that be the error?)
  • I created the OAuth Android Client Id and passed it to the module like this (I've tried to create a webclient id, I've tried it through firebase, none of the alternatives worked):

    GoogleSignin.configure ({ webClientId: GOOGLE_CLIENT_ID, offlineAccess: false, });

2

There are 2 best solutions below

0
Thallysson Klein On BEST ANSWER

I found the error, something very simple that went unnoticed. The name of the application package is not the same as what I had informed for Google Console / Firebase, so it was enough to change the name and it worked.

9
Ariel Perez On

Make sure you follow the main steps for the Google sign-in integration:

Google Sign-in integration

Please put special focus on the configuration for the Google Api Console Project. You must provide the SHA-1 hash of your signing certificate.

In case you have some doubt about your hash:

  1. For debug hash check in your android/app/build.gradle. This is the default signing configuration for debug
signingConfigs {
        debug {
            storeFile file('debug.keystore')
            storePassword 'android'
            keyAlias 'androiddebugkey'
            keyPassword 'android'
        }
    }

You can retrieve the the SHA1 hash with this command. I'm asumming you're in the path of your debug.keystore file. (default android/app/debug.keystore)

keytool -list -v -keystore debug.keystore

password: android

Copy the SHA1 value from the terminal and include in the Console configuration XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX

  1. For release hash you should create your own production keystore and get the SHA1 hash to include in your Console configuration.

Here is some information about retrieve the hash Authenticating Your Client

Here is some information to generate your own keystore App Signing