Latest Expo client crashes when trying to google sign in

Yea same as. I’m on SDK 31 as well.

This only happened after I updated to Expo Android client version 2.11.0. It was fine before then! The android apk build is fine, just not the expo client.

Just to confirm – this is on iOS and not Android?

Hi, same problem here with SDK 32, exp-cli 2.18.7 and Expo 2.11.0 on Android. But it works on ios simulator with Expo 2.11.0

1 Like

This is on Android for me.

Would you care to create a Snack that will reproduce the issue? It would be helpful in debugging the problem.

I’m having the same issue. Android Expo client: AuthSession fails to redirect back to app after successful auth

I found an apk for the client for 2.11.1 but the issue was still not resolved.

UPDATE: I Googled and found an apk mirror of Expo Client 2.10.6 and confirmed that AuthSession redirects successfully and I can log in fine on Android Expo Client 2.10.6 on my LG G7

The issue is happening in Expo Client for android versions 2.11.0 and 2.11.1

2.11.1 wasn’t deployed in order to fix this issue. Do you have maybe a reproducible Snack? :pray:

You can reproduce this by following the docs provided by Expo themselves.

What code was put into the Android client version 2.11.0 relating to google sign in? That’s how you will debug this issue. You need to check the delta.

@clearviewsocial mentions it is not reproducible in 2.10.6. So I would check the delta between that version and 2.11.0. Something went in in the meantime which is causing this break.

  1. I’m not sure which API you’re using to sign in to Google. There are two as of now: GoogleSignIn and Google.logInAsync. Providing the code would clarify any doubts.
  2. Google API has gone through a major rework during SDK32—SDK33 cycle (actually it’s the AppAuth API that has been redone, but Google is just using it). It won’t be easy to find any clue just looking at the diff.
  3. GoogleSignIn has less changes, but it is kind of improbable that you’re using this API to log in inside Expo Client since (at least according to the documentation) it is not designed to work inside Expo Client.

Have a similar issue and I think Google sign-in is not the culprit here.

I created a clean new project using “expo init” with predefined template and tried to open it on my android 8.0 device but the Expo client kept on crashing whenever “Run on Android” option was selected.

This was working find before the latest Expo update.

Also, within the npm terminal I am getting the message “This version of the expo app is out of date” even though my device is running the latest playstore version of the Expo app.

Hey @sjchmiela, Here’s my code minus the client id’s etc.:

export const signInWithGoogle = () => async (dispatch, getState) => {
  try {
    const result = await Google.logInAsync({
      androidClientId: '',
      iosClientId: '',
      androidStandaloneAppClientId: '',
      webClientId: '',
      scopes: ['profile', 'email'],
    });
    if (result.type === 'success') {
      // Sign into Firebase with the credential from the Google user.
      const credential = firebase.auth.GoogleAuthProvider.credential(result.idToken, result.accessToken);
      firebase
        .auth()
        .signInAndRetrieveDataWithCredential(credential)
        .catch(function(error) {
          console.error('Error with Firebase sign in ', error.message);
        });
    }
  } catch (e) {
    console.log('Error with Google sign in: ', e.message);
  }
};

Like @clearviewsocial said in his post, it launches the expo web google sign in, after clicking on an account it attempts to redirect back to the app and it always crashes. I’ve submitted the bugs through android feedback to allow you to see logs. There are no exceptions occurring on my side in the catch statements.

My issue is not a Google Sign In issue - I’m not using Google to sign in and I’m having this issue. I can log into Twitter, Facebook, or LinkedIn fine via AuthSession, but the redirect back into the app causes the whole Expo client to crash. I think it’s an AuthSession issue

Facebook sign in seems to work fine for me:

export const signInWithFacebook = () => async (dispatch, getState) => {
  try {
    const options = {
      permissions: ['public_profile', 'email'],
    };
    const result = await Facebook.logInWithReadPermissionsAsync('', options);

    if (result.type === 'success') {
      // Build Firebase credential with the Facebook access token.
      const credential = firebase.auth.FacebookAuthProvider.credential(result.token);

      // Sign in with credential from the Facebook user.
      firebase
        .auth()
        .signInAndRetrieveDataWithCredential(credential)
        .catch(error => {
          // Handle Errors here.
          console.log('signInWithFacebook - error: ', error);
        });
    }
  } catch (e) {
    console.log('Error with Facebook sign in: ', e.message);
  }
};

Could you please try using these instructions to reproduce the crash?

Could you please try opening Expo APIs app on the offending device with the latest Expo client?

  1. Close Expo Client.
  2. Open Expo Client.
  3. Go to Explore tab (bottom tab bar).
  4. Tap Expo APIs row. (A new experience should open. Its source code is here.)
  5. There are multiple showcase screens. We will be interested in checking out AppAuth, AuthSession, Google and GoogleSignIn. Please go through them and check if you are able to reproduce the crash in any one of them.
  6. If you can’t, could you try creating a Snack that would reproduce the crash?

I tried to reproduce the crash on all the 4 screens using:

  • device with Android 7.1,
  • emulators with Android 8.0 and 7.0

and none crashed. :cry:

Same issue here. This is a disaster after I upgraded to Expo 32. AuthSession crashes when I authenticate against my own provider. When redirect happens…it blows up, expo crashes and close.

I tried what you said and it says “AuthSessin Test” and it also crashed and burn with Google Authentication on Android.

Expo Cli: 2.18.7
“expo”: “^32.0.0”,
“react-native”: “https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz”,
“react”: “16.5.0”
"Android: 8.0.0
Device: Sony Xperia
Expo Android: 2.11.0

I try the 4 screens in Expo API and only GoogleSignIn work and the others crash. My device is on Android 8.0.

We need this fixed. Personally this is affecting my production deploy as I was suppose to deploy yesterday now because, of this we’re delayed.

Thank you for replying, I rechecked and I have tested only 7.0, 8.1 and 9.0. I think the problem may exist only on Android 8.0. On it!

I have reproduced the issue, it happens only on Android 8.0 and is related to this problem:

4 Likes