Google sign in invalid_request: Custom scheme URIs are not allowed for 'WEB'

const result = await Google.logInAsync({
        behavior: 'web',
        scopes: ['profile', 'email'],
        clientId: <my_client_id>,
      });

That is my code. And every time I tap on google sign in, it returns the same error -

  1. That’s an error.

Error: invalid_request

Custom scheme URIs are not allowed for ‘WEB’ client type.

When I create an apk for the same, the error I get is -

Error: deleted_client

Does anyone know how to fix this?

Hey @tanaysharda,

What SDK version are you running?

Cheers,
Adam

This is when I’m trying to update to 32 (and 32 is showing up these errors). But even when I roll back to run 31, it still says deleted_client in the apk. I cannot push any updates now because google login will break.

Okay so I got it to work. Turns out the bug was somewhere entirely else.

Because I was testing, I was building my apk with the --no publish flag. Turns out that when you use it, none of the app changes are picked up, and this resulted in my old code being reused which was using the old credentials. Took me 5 days to figure this out. Expo should be more careful about documenting this.

Glad you got it figured out, @tanaysharda. I suppose this isn’t a bug rather than the expected behavior, but I agree that there’s room for improvement here regarding documentation and we’re always looking to strengthen our learning resources. Can you think of any areas in particular or information you think would’ve helped to avoid this situation?

Yes.

  1. If I knew that --no publish doesn’t actually update the code
  2. If GoogleSignIn could be tested better through expo. Now I have to build an apk every time to test it.