com.google.android.gms.common.api.ApiException:10 [英] com.google.android.gms.common.api.ApiException: 10

查看:152
本文介绍了com.google.android.gms.common.api.ApiException:10的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Google登录示例,但是它不起作用.我收到ApiException statusCode = 10

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

我使用与此处相同的代码 https://developers.google.com/identity/sign-in/android/

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

推荐答案

这是两个问题. 首先,如果添加'.requestIdToken(getString(R.string.server_client_id))',则需要在api控制台中创建Web应用程序Oauth2.0.尝试阅读此" https://developers.google.com/identity/sign-in/android/start '.

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' .

第二,如果您不使用'requestIdToken',则您创建的类型是android Oauth2.0. Second不需要clientID,但是如果您添加代码'requestIdToken',则需要添加Web应用程序clientID.

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.

这篇关于com.google.android.gms.common.api.ApiException:10的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆