GoogleSignIn.signInAsync: DEVELOPER_ERROR


#1

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

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


@bacon Hope you can check this out.


#3

I think I was getting that until I added certificate hash correctly. This helped me https://github.com/expo/expo/issues/3439#issuecomment-463625673


#4

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


#5

I did it but it didn’t work


#6

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: https://blog.expo.io/expo-sdk-v32-0-0-is-now-available-6b78f92a6c52

Cheers,
Adam


#7

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


#8

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


#9

@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.


#10

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


#11

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


#12

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.


#13

Thank you :grin: