com.google.android.gms.common.api.ApiException: 10

MonStar picture MonStar · Jul 8, 2018 · Viewed 8.2k times · Source

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/

Answer

DEVPROG picture DEVPROG · Jul 30, 2018

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.