我们自己找到了答案。我们搞砸了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
当我们查看Google API console 的仪表板时,我们还发现Google Play Games Services 有很多错误。
仔细一看,我们发现几乎所有这些都是客户端错误 (4xx),但我们找不到原因。
解释:
我认为在开发过程中的某个时刻,我们的签名证书的 SHA1 存在问题,并认为我们可以在 Google API console 中手动创建一个新的 OAuth2.0 客户端来更新 SHA1。
根据这个Google Developers video,这很糟糕,它说应该在Google Play Developer console 中创建一个OAuth2.0 客户端,因为它会自动创建客户端ID 并将其与Achievements 和Leaderboards 相关联。如果在Google API console 中以相反的方式创建它,将没有链接,它会返回一个有效的登录名,但不知道应该使用哪个Achievements 和Leaderboards,并且会返回错误。
解决方案:
由于Google Play Developer console 中的关联应用发布后无法再删除,因此我们对其进行了重命名,以便将它们列在关联应用 (zz-mygame) 的底部,并删除了 OAuth 2.0 客户端我们在Google API console 中手动创建,因为它们无论如何都不能使用Google Play services。
然后,我们在 Google Play Developer Console 的游戏的游戏服务部分创建了新的链接应用程序,添加了正确的 SHA1,这会生成一个与 Play services 连接的新 OAuth 2.0 客户端。然后,我们在凭据部分的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 中的错误也不再出现。