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:)
- User presses a button to execute the onGoogleSignIn function above
- “Trying google sign in” is printed to the JavaScript console as expected
- Google accounts screen displays on Android device
- 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
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Reactions: 10
- Comments: 27 (11 by maintainers)
Commits related to this issue
- [expo-app-auth] Add missing SDK32 activity to AndroidManifest.xml (#3449) # Why closes: https://github.com/expo/expo/issues/3157 # How Added missing activity to AndroidManifest.xml # Test... — committed to expo/expo by Szymon20000 5 years ago
- [expo-app-auth] Add missing SDK32 activity to AndroidManifest.xml (#3449) # Why closes: https://github.com/expo/expo/issues/3157 # How Added missing activity to AndroidManifest.xml # Test... — committed to expo/expo by Szymon20000 5 years ago
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-nativeandreactversions for expo sdk v31.0 Nonetheless, I found them,Change your
package.jsonto:and change the sdkVersion in app.json:
"sdkVersion": "31.0.0"Now
rm -rf node_modulesand runyarnornpm iagain. Then try to run the app byyarn startornpm 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:
versionprop in yourapp.jsontoUNVERSIONED- 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
UNVERSIONEDit would be cloned over to32.0.0but 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.