3

I'm trying to use google sign in sample, but it doesn't work. I receive ApiException statusCode = 10

I use the same code like here https://developers.google.com/identity/sign-in/android/

MonStar
  • 102
  • 1
  • 2
  • 14
  • As suggested in the [documentation](https://developers.google.com/android/reference/com/google/android/gms/common/api/CommonStatusCodes#inherited-method-summary), try checking the log if there are any hint of configuration issue. Also try this [Google Sign-In for Android](https://developers.google.com/identity/sign-in/android/start), this sample app will guide you step by step on how to implement Android sign-in properly. Hope this helps. – Mr.Rebot Jul 09 '18 at 07:03
  • Please add the referred code to the body of the question. – sɐunıɔןɐqɐp Jul 30 '18 at 08:15

2 Answers2

12

This is two problems. First, if you add ' .requestIdToken(getString(R.string.server_client_id))', you create web application Oauth2.0 in api console. try reading this 'https://developers.google.com/identity/sign-in/android/start' .

Second, if you not use 'requestIdToken', you create type is android Oauth2.0. Second does not require a clientID but if you add code 'requestIdToken', need to add webapplication clientID.

DEVPROG
  • 121
  • 3
  • This is a very helpful answer and solved my issue. Thanks. Basically if you're using the Android OAuth 2.0, you shouldn't be using the requestIdToken. – Asim Apr 17 '19 at 17:26
  • Very helpful answer – Nux Jun 16 '19 at 19:40
  • Hi, I am getting this error when using the requestServerAuthCode() method? Is there any solution to this? Because I see that it looks like a developer problem! – Kwnstantinos Nikoloutsos Nov 19 '19 at 19:41
0

I had this problem by using SHA-256 fingerprint keys. I switched to SHA-1 and now the error is gone.

Martin Braun
  • 10,906
  • 9
  • 64
  • 105