我们自己找到了答案。我们搞乱了配置Google Play Developer console
并在Google API console
.
观察结果:
我们注意到我们的应用程序有不同的 OAuth2 客户端 ID,例如:
Google Play 开发者控制台,链接应用程序详细信息视图
121212121212-4k97si3bnwertwertwet78oj571nl81ce3.apps.googleusercontent.com
Google API 控制台、凭据、OAuth 2.0 客户端 ID
121212121212-h25jh8qrps8awertwetertweagp3n3t.apps.googleusercontent.com
We also saw that we had a lot of errors coming from the Google Play Games Services
when we looked in the Dashboard of the Google API console
.
仔细一看,我们发现几乎所有错误都是客户端错误(4xx),但我们无法找出原因。
解释:
我认为在开发过程中的某个时刻,我们的签名证书的 SHA1 出现了问题,我们想,我们可以创建一个新的OAuth2.0
客户端手动在Google API console
更新 SHA1。
根据这个,这很糟糕这说的是OAuth2.0
客户端应该创建在Google Play Developer console
,因为它会自动创建客户端 ID 并将其与Achievements
and Leaderboards
。如果它是以相反的方式创建的Google API console
,不会有链接,它将返回一个有效的登录,但不知道是哪个Achievements
and Leaderboards
应该使用并且会返回错误。
解决方案:
作为链接的应用程序Google Play Developer console
它们发布后就无法再删除,我们将它们重命名,以便它们列在链接应用程序 (zz-mygame) 的底部,并且我们删除了OAuth 2.0
我们手动创建的客户端Google API console
因为他们没有与Google Play services
anyway.
然后,我们在游戏的游戏服务部分创建了新的链接应用程序Google Play Developer Console
,添加了正确的 SHA1,这生成了一个新的OAuth 2.0
与连接的客户端Play services
。然后我们在Google API console
在“凭据”部分,看到一个新的OAuth 2.0
添加了客户端,并且该客户端具有与游戏服务的链接应用程序部分相同的 ID (121212121212-34adfasdfsf34343422zzzz3433.apps.googleusercontent.com)Google Play Developer console
.
经过这些更改后,成就工作正常,并且已经在使用开发版本和具有测试访问权限的用户测试游戏时Google Play Game Services
,成就现在将显示在Google Play Games App
并有一个自己的选项卡列出所有成就。还有错误在Google API console
不再出现了。