react-native-google-signin/google-signin

[expo] NSInvalidArgumentException: Your app is missing support for the following URL schemes

Closed this issue · 8 comments

Description

App crashes when calling GoogleSignin.signIn()

Config setup with expo:

      ...,
      ios: {
        supportsTablet: true,
        usesAppleSignIn: true,
        bundleIdentifier: "com.myapp",
        infoPlist: {
          CFBundleURLTypes: [
            {
              CFBundleURLSchemes: ["com.googleusercontent.apps.94964xxx0258-xxxxxxxxxxxxxxxx"]
            }
          ]
        }
      },
    ...,
      plugins: [
        "expo-router",
        "expo-secure-store",
        "expo-apple-authentication",
        [
          "@react-native-google-signin/google-signin",
          {
            iosUrlScheme: "com.googleusercontent.apps.94964xxx0258-xxxxxxxxxxxxxxxxxxxxx"
          }
        ],
     ...

Crash output

[CoreFoundation] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Your app is missing support for the following URL schemes:
949643400258-lbit2a6qopgb359nafiqe28hrpgd6age.apps.googleusercontent.com'
*** First throw call stack:
(
0   CoreFoundation                      0x00000001804ae138 __exceptionPreprocess + 172
1   libobjc.A.dylib                     0x0000000180087db4 objc_exception_throw + 56
2   CoreFoundation                      0x00000001804ae048 -[NSException initWithCoder:] + 0
3   PsicoPilot                          0x000000010063616c -[GIDSignIn signInWithOptions:] + 444
4   PsicoPilot                          0x0000000100634f68 -[GIDSignIn signInWithPresentingViewController:hint:additionalScopes:completion:] + 208
5   PsicoPilot                          0x0000000100704b68 __40-[RNGoogleSignin signIn:resolve:reject:]_block_invoke + 372
6   libdispatch.dylib                   0x0000000180170104 _dispatch_call_block_and_release + 24
7   libdispatch.dylib         <…>

This is expo version 51, no firebase.

Tried mix and matching all solutions found here
I'm willing to pay for sponsor version but I need to understand if this can actually work

Hello and thanks for asking,
Did you run these steps?

https://react-native-google-signin.github.io/docs/setting-up/expo#rebuild-the-app
Thank you 🙂

Yes I have @vonovak, exactly how the docs suggest.
I appreciate your help debugging this

Can you please create a Minimal, Reproducible Example that we can see the issue with? The most effective reproducible examples are created by starting a new project from scratch and adding in only the necessary pieces to reproduce the issue.
Without this, the issue is not actionable.
Thank you

i have same problem but now i success

i just done

https://react-native-google-signin.github.io/docs/setting-up/expo#rebuild-the-app

setting

and
npx expo prebuild --clean
npx expo run:ios

I'm unable to reproduce it in a minimal setup (as I suspected).
I do see it properly set in XCode though.
Can you help me debug this further?

image

I noticed that the crash log states that the app is missing support for:
************************.apps.googleusercontent.com
While in the app.json it's defined in reverse domain. Could that be the issue?

Yes!
In the GoogleSignin.configure() call, setting up iosClientId in reverse order works

Glad you got it working!