I had the same problem, after solving the research, he resumed that server_client_id contains an invalid value, or your google_services.json did not enable oauth_client with the client_id registered in your keystore.
requestIdToken(getString(R.string.server_client_id))
R.string.server_client_id use the OAuth 2.0 client identifier for the web application . And the OAuth client ID for Android is used in google_services.json
Usually we use 2 keystore, 1 using the debug store and 1 using the signed keystore for publishing. Therefore, if we want in debugging and publishing mode, double-register your OAuth client ID for Android, 1 using SHA1 from the debug store and 1 from the signed key store for publishing.
small example in my google_services.json
"oauth_client": [ { "client_id": "xxx-client-id.com", "client_type": 1, "android_info": { "package_name": "com.app.android", "certificate_hash": "xxxhash" } }, { "client_id": "yyy.client-id.com", "client_type": 1, "android_info": { "package_name": "com.app.android", "certificate_hash": "yyyhash" } } ],
RaditzLawliet Nov 15 '15 at 17:23 2015-11-15 17:23
source share