[英]com.google.android.gms.common.api.ApiException: 10
I'm trying to use google sign in sample, but it doesn't work.我正在尝试使用 google 登录示例,但它不起作用。 I receive ApiException statusCode = 10
我收到 ApiException statusCode = 10
I use the same code like here https://developers.google.com/identity/sign-in/android/我在这里使用相同的代码https://developers.google.com/identity/sign-in/android/
This is two problems. 这是两个问题。 First, if you add ' .requestIdToken(getString(R.string.server_client_id))', you create web application Oauth2.0 in api console.
首先,如果添加'.requestIdToken(getString(R.string.server_client_id))',则可以在api控制台中创建Web应用程序Oauth2.0。 try reading this ' https://developers.google.com/identity/sign-in/android/start ' .
尝试阅读此“ https://developers.google.com/identity/sign-in/android/start ”。
Second, if you not use 'requestIdToken', you create type is android Oauth2.0. 其次,如果您不使用“ requestIdToken”,则您创建的类型是android Oauth2.0。 Second does not require a clientID but if you add code 'requestIdToken', need to add webapplication clientID.
第二个不需要clientID,但是如果添加代码'requestIdToken',则需要添加Web应用程序clientID。
I had this problem by using SHA-256 fingerprint keys.我通过使用 SHA-256 指纹密钥遇到了这个问题。 I switched to SHA-1 and now the error is gone.
我切换到 SHA-1,现在错误消失了。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.