GoogleSignIn.signInAsync: DEVELOPER_ERROR

I’m using GoogleSignIn.signInAsync and I get GoogleSignIn.signInAsync: DEVELOPER_ERROR when I try to run it.
Configure the app.json as it came in the expo documentation:

"ios": {
      ...
      "bundleIdentifier": "<bundleIndentifier>",
      "config": {
        "googleSignIn": {
          "reservedClientId": "<REVERSE_CLIENT_ID"
        }
      },
    ...
    },
"android": {
      ...
      "package": "<package>",
      "googleServicesFile": "./google-services.json",
      "config": {
        "googleSignIn": {
          "certificateHash": "<SHA1_Hash>"
        }
      }
    },

and my code:

async function logInGoogle() {
  try {
    await Expo.GoogleSignIn.initAsync({ clientId: '<YOUR_IOS_CLIENT_ID>' });
  } catch({ message }) {
    console.log('GoogleSignIn.initAsync(): ' + message);
    return null;
  }

  try {
    await Expo.GoogleSignIn.askForPlayServicesAsync();
    const { type, user } = await Expo.GoogleSignIn.signInAsync();
    if (type === 'success') {
      console.log(user);
    }
  } catch (error) {
    console.log(error.toString());
  }
}

any ideas?

2 Likes

I am also facing this in ios when I call GoogleSignIn.initAsync({...}.


@bacon Hope you can check this out.

I think I was getting that until I added certificate hash correctly. This helped me [expo-google-sign-in][android][standalone] GoogleSignIn.signInAsync: DEVELOPER_ERROR · Issue #3439 · expo/expo · GitHub

This is happening in ios and it was working fine until expo sdk 31 with old api.

I did it but it didn’t work

Hey everyone,

Are you running SDK32? How are you all importing the module? As of SDK32, you can no longer import the whole Expo package via import Expo from 'expo', you’ll either have to import the specific module via import { module_name } from 'expo' or if you still want to import the whole package, import * as Expo from 'expo'. You can read about this in the blog post’s breaking changes: Expo SDK v32.0.0 is now available | by Eric Samelson | Exposition

Cheers,
Adam

I already import it as import {GoogleSignIn} from ‘expo’; but it didn’t solve the problem :disappointed_relieved:

The problem is that DEVELOPER_ERROR does not give much information about what the error may be.

@adamjnav I’ve knew that part already.
Below is import statement.

import { Facebook, Amplitude, GoogleSignIn } from 'expo';

Usage

    try {
      await GoogleSignIn.initAsync({
        clientId: '{MY_CLIENT_ID}',
        scopes: ['profile', 'email'],
        behavior: 'web',
      });

Then throws above error. No idea how to resolve this because it is hard to track down the part.

This issue may be of use: https://github.com/expo/expo/issues/3439

I had already done it and it does not work for me with the certificateHash

My apologies. Forgot to re-read the original post and just noticed the issue had already been linked to. I brought this up internally. Will follow up when we know more.

Thank you :grin:

In GoogleSignIn.signInAsync: DEVELOPER_ERROR - #3 by rajuru I reported that it’s working.
Now I found that it works when I use the apk locally (download and install in my mobile from expo builds). however, if I publish the app to google play store and then install, it’s not working anymore. I get same developer error.

Any suggestions?

2 Likes

Ok, it worked now after I copied the sha1 hash from Google Play Console and added it to firebase android project. :sunglasses:

3 Likes

Hey, which SHA-1 fingerprint did you use from Google Play Console? Did you use the App signing certificate or the Upload certificate?

1 Like

Hi Jon, I have been trying the GoogleSignIn feature in Expo v36.0.0. Same error exists. (I am testing this on Android device only currently)

I am following this example : GitHub - EvanBacon/expo-google-sign-in-demo: A demo for using native Google Auth in Expo with expo-google-sign-in
and the latest documentation in GoogleSignIn. However, I realise that they have missed out a few points which are causing developer error.

Solution
Solved it with this link : [expo-google-sign-in][android][standalone] GoogleSignIn.signInAsync: DEVELOPER_ERROR · Issue #3439 · expo/expo · GitHub

Few important steps are :

  1. Get Android hashes
  2. Add fingerprint to android.config.googleSignIn.certificateHash in app.json
  3. Add fingerprint to Android App registered in Firebase.

All the three steps are required. If not, it won’t work. Tested this out for a few days as well.

I upgraded from Expo 35 to 36 today and now getting DEVELOPER_ERROR.

I already did the 3 steps when I was in 35 (fingerprint, certificateHash). Do I have to redo them again for the upgrade to 36? Help needed!

you should not have to redo them. did you possibly clear the credentials when doing a new build? you should use the same keystore

I only did expo upgrade and expo build. However, when I to my firebase console and downloaded the google-services.json file, it is changed from the one I had originally. I will try rebuilding a new APK with the new json file.