1

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, });

Thallysson Klein
  • 157
  • 2
  • 15

2 Answers2

4

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

Ariel Perez
  • 499
  • 3
  • 7
  • - I followed the Google configuration steps for android - Redid the process of creating an oauth client with the correct SHA1 - I redid the process of getting the client id and going to the library - I ran, and again I came across the same error – Thallysson Klein Jun 03 '20 at 16:35
  • 1
    Please post your current code of the initialization. (Do not show your keys) – Ariel Perez Jun 03 '20 at 17:13
  • The whole code: https://gist.github.com/ThallyssonKlein/2a6b5d8c4554c191d6f4b62dff0b5693 – Thallysson Klein Jun 03 '20 at 18:07
  • Be sure to provide the correct webClientId. If you open the google-services.json is the one with this format `{ "client_id": "xxxxxxxxxxx-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.apps.googleusercontent.com", "client_type": 3}` – Ariel Perez Jun 03 '20 at 18:17
  • The correct json is downloaded from here: https://i.imgur.com/VEvAex5.png right? – Thallysson Klein Jun 03 '20 at 19:17
  • I did a test now. I created a firebase project for the Google Console project, created an android app within the firebase project, added the same SHA1 and then tried it with the client id that came on google-services.json in the same way you showed it. The same mistake happened. – Thallysson Klein Jun 04 '20 at 16:04
  • Check this`https://github.com/react-native-community/google-signin/issues/659. Some people was getting the error because the support email was missing. – Ariel Perez Jun 04 '20 at 16:23
  • Yes, your answer helps me fix this problem. tks <3 – Noname Dec 30 '20 at 08:26
  • 1
    For me, goodle sign is working in debug but it is not working for release. We have followed all steps. so far no luck – dnyanesh Mar 29 '21 at 13:55
1

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.

Thallysson Klein
  • 157
  • 2
  • 15