它看起来有些时候我可以成功登录,但通常 – 没有.如果我检查了API流量,大约有10%得到响应代码= 200,其他 – 404.
> games.applications.played
> games.events.record
当我试图检查日志中的错误时,我看到:
11705-13707/com.google.android.gms W/GamesServiceBroker: Client connected with SDK 12171000,Services 11975436,and Games 54390036 11705-9262/com.google.android.gms E/BoundService: No such BoundService for action: com.google.android.gms.auth.APP_CERT 11705-9262/com.google.android.gms E/BoundService: No such BoundService for action: com.google.android.gms.auth.APP_CERT 691-778/system_process E/PROXIMITY: ProximitySensor: unknown event (type=3,code=0) 8876-8890/com.agminstruments.drumpadmachine V/FA: Inactivity,disconnecting from the service 691-778/system_process E/PROXIMITY: ProximitySensor: unknown event (type=3,code=0) 2254-2269/? I/PerfService: PerfServiceNative_getPackName 11705-16860/com.google.android.gms E/Volley: [3966] BasicNetwork.performRequest: Unexpected response code 400 for https://www.googleapis.com/games/v1/players/me?language=ru-RU 11705-9262/com.google.android.gms E/PlayerAgent: Unable to load player g08394879143000804289 11705-9262/com.google.android.gms W/PlayerAgent: {"errors":[{"domain":"global","reason":"invalid","message":"Invalid applicationId with value . Reason: No application ids specified."}],"code":400} 3978-3978/com.google.android.play.games.ui I/SignInActivity: Transition from 8 to 11 3978-3978/com.google.android.play.games.ui W/SignInActivity: onSignInFailed()... 3978-3978/com.google.android.play.games.ui W/SignInActivity: Sign in Failed during 8 3978-3978/com.google.android.play.games.ui W/SignInActivity: ==> Returning non-OK result: 10002
我不明白为什么消息“无效的applicationId值”中没有ID.因为我已经在应用程序中添加了id.我也试图更改ID,在这种情况下我得到一个ID XXXXXXXXXXXX没有与app my.package.name链接的错误.
我还仔细检查了应用程序ID,SHA指纹,重新导入google-services.json还尝试从链接的应用程序手动添加OAuth2客户端ID.检查播放服务说明,一切看起来都不错.
我还能检查什么?
更新:
尝试将播放服务更新为11.8.0并使用GoogleSignInClient
mGoogleSignInClient = GoogleSignIn.getClient(application,GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN); activity.startActivityForResult(mGoogleSignInClient.getSignInIntent(),312);
但也有一个错误:
com.google.android.gms.common.api.ApiException: 4:
解决方法
首先从调试Play服务开始,
>在代码中启用调试播放服务>制作apk>在设备上安装>从android sdk>中的“tools”文件夹中打开“Monitor” <将设备连接到PC>跑
>调试后,如果收到此消息
“You have wrong OAUth2 related configurations,please check. Detailed
error; UNREGISTERED_ON_API_CONSOLE” “OnSignInFailed()…”
>去吧
只需复制/粘贴“应用程序签名证书”“SHA-1证书指纹” – 而不是“上载证书”“SHA-1证书指纹”,它是您的密钥库中的一个,位于API ID客户端OAuth 2.0中.
这将做你的工作!
截至目前,谷歌玩游戏已不再在本地连接.但是当它被导入谷歌游戏商店时它已成功连接(谷歌应用程序签名正是它应该做的事情:它将你的SHA1从“上传证书”改为“应用程序签名”).
注意:上图是从GitHub开放问题中获取的.希望这可以帮助!!