expo: [expo-app-auth][android] Google Signin Doesn't Resolve and Redirects to Projects Screen in Expo Android App

Environment

Expo CLI 2.6.14 environment info: System: OS: Linux 4.4 Ubuntu 16.04.4 LTS (Xenial Xerus) Shell: 4.3.48 - /bin/bash Binaries: Node: 10.15.0 - ~/.nvm/versions/node/v10.15.0/bin/node Yarn: 1.10.1 - /mnt/c/Program Files (x86)/Yarn/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.15.0/bin/npm npmGlobalPackages: expo-cli: 2.6.14

Target: Android

Steps to Reproduce

Recreate Google sign-in example from documentation as

my actual code is as follows:

onGoogleSignIn = async () => {
    console.log('Trying google sign in')

    this.setState({ loginInProgress: true })
    try {
      const result = await Google.logInAsync({
        androidClientId: googleCreds.androidClientID,
        iosClientId: googleCreds.iosClientID,
        scopes: ['profile', 'email'],
      });
      console.log({result});
      if (result.type === 'success') {
        return result.accessToken;
      } else {
        return {cancelled: true};
      }
    } catch(e) {
      return {error: true};
    }
 }

(Write your steps here:)

  1. User presses a button to execute the onGoogleSignIn function above
  2. “Trying google sign in” is printed to the JavaScript console as expected
  3. Google accounts screen displays on Android device
  4. User selects a Google account from accounts screen

Expected Behavior

The Google.logInAsync function should resolve with Google account information or an error should be caught.

Actual Behavior

“Trying google sign in” is printed to the JavaScript console as expected The Google.loginAsync function does not resolve, and no error is caught The “Projects” screen from the Expo Android app is displayed.
Additionally, my application displays an ActivityIndicator when the user presses a Google Sign In that initiates the process. The ActivityIndicator displays and remains displaying when I return to the application after being sent to the Projects screen indicating my application is not crashing or has not shut down in the process

No error screen appears during the process.

Reproducible Demo

Snack

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Reactions: 10
  • Comments: 27 (11 by maintainers)

Commits related to this issue

Most upvoted comments

The fix has landed on master, we’ll notify you once/if we also release an updated version of the Expo Client, to which the fix applies (standalone/ejected builds aren’t supposed to be affected by this bug).

@Szymon20000 has released an update to Expo Client, 2.10.6, which is already available as an update on the Play Store. It should fix the issue. 🙂

@danikane Thank you very much! It works like a charm now! Sorry I am new to RN and Expo. I forgot that I still needed to install Expo on my emulator too. I upgraded Expo client in my emulator by drag and drop as your guide mentioned. Now Google Login works perfectly!

I faced this issue today, after much debugging reverting to version 31.0 fixed it for me.

But I faced some difficulty in getting the react-native and react versions for expo sdk v31.0 Nonetheless, I found them,

Change your package.json to:

...
"expo": "^31.0.0",

  "react": "16.5.0",

  "react-native": "https://github.com/expo/react-native/archive/sdk-31.0.0.tar.gz"
...

and change the sdkVersion in app.json: "sdkVersion": "31.0.0"

Now rm -rf node_modules and run yarn or npm i again. Then try to run the app by yarn start or npm start. It works!! 💯

I have partially identified the issue, something to do with the versioning of the library. Hopefully we have it resolved soon. Until then you could:

  • roll back to 31
  • try setting the version prop in your app.json to UNVERSIONED - this may not work on the play store client but it does on mine.

The versioning should be such that when I built the module using UNVERSIONED it would be cloned over to 32.0.0 but it seems like something here isn’t working as expected (or I’m just mixing the issue up with some other problem 🙃 ) Really sorry for the inconvenience.

@minhdang-idev I mean the expo client on your phone. Its version should be >= 2.10.6 to work fine as @sjchmiela said.

@minhdang-idev did you update your expo client?

Can confirm rolling back to SDK 31 seems to be the best solution at the moment. Will wait for the Expo team to fix this issue in SDK 32.