google-signin: WRONG SIGNIN Error: DEVELOPER_ERROR at new GoogleSigninError

I can press the button and select a google profile, but get this error. It looks like the user is null at the point of sign in. I followed the tutorial pretty closely, is there something I’m doing wrong? My code:

  _signIn() {
    GoogleSignin.signIn()
    .then((user) => {
      console.log(user);
      this.setState({user: user});
      this.props.navigator.push({
        component: Account
      });
    })
    .catch((err) => {
      console.log('WRONG SIGNIN', err);
    })
    .done();
  }
async _setupGoogleSignin() {
    try {
      await GoogleSignin.hasPlayServices({ autoResolve: true });
      await GoogleSignin.configure({
        webClientId: 'MY-CLIENT-ID',
        offlineAccess: false
      });

      const user = await GoogleSignin.currentUserAsync();
      console.log(user);
      this.setState({user});
    }
    catch(err) {
      console.log("Play services error", err.code, err.message);
    }
  }
<GoogleSigninButton
    style={{width: 312, height: 48}}
    size={GoogleSigninButton.Size.Wide}
    color={GoogleSigninButton.Color.Light}
    onPress={() => { this._signIn(); }}/>

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 21
  • Comments: 21

Most upvoted comments

I had the same problem, was using the wrong client Id ie."oauth_client": [ { "client_id": "first client_id",//was using this right here<-- "client_type": 1, "android_info": { "package_name": "com.myap", "certificate_hash": "*********" } }, { "client_id": "when i used this one, it worked",//use this right here <--- "client_type": 3 } ], This is code from the exported google-services json file

In my case I was using the android webClientId generating this error you need user the web webClientId it is generated in the console!

1. Create a firebase project
2. Create a android app with SH-1 key (
       1. Go to Android studio click on gradle by your top right
       2. click on App
       3. click on Android
       4. click on signingReport 
       5. Copy SHA1 key and use it to create the firebase android app
3. Go to the authentication part of your firebase app (Left side menu)
     1. Click on sign in method
     2. Web SDK configuration under Google and copy the key paste it in your Web Client ID config
4. Head back to android firebase app and download `google-service.json`
     1. it should contain the SH1 just added as `certificate_hash`

This is debug

I experienced the DEVELOPER_ERROR 10 as I was using the wrong web client id.

Firebase was not creating the client is in my google apis console, but it was generating it’s own web client id inside firebase. The problem was solved once I added that web client id to my android app inside

export const config = { 'webClientId': '1234567889.apps.googleusercontent.com', };

Head to your firebase app, Authentication -> Sign-in methods -> Google You will find the list of Whitelisted clients ids and the option to add new ids

web_client_id

@Anees-Raja I just added a debug section too . I copied/pasted from release

 signingConfigs {
        debug {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
        release {
            if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
                storeFile file(MYAPP_RELEASE_STORE_FILE)
                storePassword MYAPP_RELEASE_STORE_PASSWORD
                keyAlias MYAPP_RELEASE_KEY_ALIAS
                keyPassword MYAPP_RELEASE_KEY_PASSWORD
            }
        }
    }

This is described there : https://github.com/devfd/react-native-google-signin/blob/master/android-guide.md#e-getting-developer_error-error-message-on-android-when-trying-to-login

@havinhthai I think it worked because android was providing .keystore to only release version and after adding the above fix by @Kisepro we are providing it to debug version as well. so now sign in can recognize the SHA1 id which was provided you during client id creation on google console.

@hustlerism sure, look into your build.gradle in app folder. android { … signingConfigs { debug { storeFile file(‘path to your debug.keystore’) storePassword “abc” keyAlias “abc” keyPassword “abc” }

    release {
        storeFile file('path to your debug.keystore')
        storePassword "releaseStorePassHere"
        keyAlias "releaseAliasHere"
        keyPassword "releaseKeyPassHere"
    }
}

… }

just provide path for debug.keystore . copy paste debug.keystore to exact same folder structure, and you are good to go .

I’m getting the same error! My webClientId is correct. It’s fine on one computer but it’s not when I copy the debug.keystore and google-services.json to the other computer.

1. Create a firebase project
2. Create a android app with SH-1 key (
       1. Go to Android studio click on gradle by your top right
       2. click on App
       3. click on Android
       4. click on signingReport 
       5. Copy SHA1 key and use it to create the firebase android app
3. Go to the authentication part of your firebase app (Left side menu)
     1. Click on sign in method
     2. Web SDK configuration under Google and copy the key paste it in your Web Client ID config
4. Head back to android firebase app and download `google-service.json`
     1. it should contain the SH1 just added as `certificate_hash`

This is debug

thank you man you are an awesome

So the solution to this problem form me were two things, firstly the answer by @Kisepro and then the answer by @muganwas after that rebuild and your app should run smoothly.

@havinhthai it worked because you used the correct client Id, I doubt there’s anything more to it but I could be wrong.

Hi muganwas. thanks a ton!