接入google game登陆遇到的一些坑

接入google game 登陆时遇到好多坑,以下是我遇到的一些问题

 

坑1、应用启动初始化时,显示链接失败,错误如下

onConnectionFailed : ConnectionResult{statusCode=SIGN_IN_REQUIRED, resolution=PendingIntent{5550a7d: android.os.BinderProxy@815bd72}, message=null}
 

坑2、登陆时反馈4的错误码

ConnectionResult.getErrorCode() = 4

 

坑3、返回错误码 10002

Returning non-OK result: 10002

坑4、需要在谷歌api 后台设置为可用 https://console.developers.google.com/apis/api/games.googleapis.com/overview?project=

 log:Access Not Configured. Google Play Game Services API has not been used in project 828200630xxx before or it is disabled

坑5

{
 "error": {
  "errors": [
   {
    "domain": "global",
    "reason": "required",
    "message": "Login Required",
    "locationType": "header",
    "location": "Authorization"
   }
  ],
  "code": 401,
  "message": "Login Required"
 }
}

 

 

出现以上问题需耐下心来慢慢自检

1、谷歌后台的game service 是否发布,game service中的项目是否关联到发布的项目

2、应用是否发布(alpha版),并且成为测试人员 https://play.google.com/apps/testing/packagename

3、成为测试人员和手机登陆的账号确保是同一个账号

4、签名是否一致

5、version code 确保比线上的小

6、所需要的权限是否在配置文件中添加和动态请求中添加 主要为getaccount 权限

7、game service 是否设置为可用 https://console.developers.google.com/apis/api/games.googleapis.com/overview?project=

8、credentials 栏中创建好资额证书和 oAuth consent screen

library中 Google Play Game Services and Google Play Game Management and Drive API 统统设置为Enable

 https://console.developers.google.com/apis/dashboard?project=

 

 

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值