【发布时间】:2014-04-20 11:10:55
【问题描述】:
我已经坚持了好几个小时,但似乎没有任何效果。
我有一个简单的游戏,我正在尝试与 Google Play 服务集成。我有兴趣添加排行榜和一些成就。
这就是我所做的:
MainActivity 扩展了 BaseGameActivity,我已经导入了 BaseGameUtils 项目和 google-play-services_lib 项目。我已将它们都添加为游戏的库项目。
我在 Google Developers Console 中为我的产品和调试密钥创建了两个客户端 ID。
我在 Google Play 开发者控制台、游戏服务部分和此应用中添加了我的电子邮件作为测试人员。
-
当我运行应用程序时,我可以看到 Google Play 服务对话框,我可以选择一个帐户,我可以看到权限对话框。但是,当我单击确定时,我收到以下消息:
The application is incorrectly configured. Check that the package name and signing certificate match the client ID created in Developer Console. Also, if the application is not yet published, check that the account you are trying to sign in with is listed as a tester account. See logs for more information.
日志显示如下:
03-14 16:45:08.023: W/GameHelper(3839): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
03-14 16:45:08.023: W/GameHelper(3839): **** This is usually caused by one of these reasons:
03-14 16:45:08.023: W/GameHelper(3839): **** (1) Your package name and certificate fingerprint do not match
03-14 16:45:08.023: W/GameHelper(3839): **** the client ID you registered in Developer Console.
03-14 16:45:08.023: W/GameHelper(3839): **** (2) Your App ID was incorrectly entered.
03-14 16:45:08.023: W/GameHelper(3839): **** (3) Your game settings have not been published and you are
03-14 16:45:08.023: W/GameHelper(3839): **** trying to log in with an account that is not listed as
03-14 16:45:08.023: W/GameHelper(3839): **** a test account.
03-14 16:45:08.023: W/GameHelper(3839): ****
03-14 16:45:08.023: W/GameHelper(3839): **** To help you debug, here is the information about this app
03-14 16:45:08.023: W/GameHelper(3839): **** Package name : com.blabla.myapp
03-14 16:45:08.031: W/GameHelper(3839): **** Cert SHA1 fingerprint: A9:5C:17:57:0D:74:1A:11:FF:8C:03:B9:7C:8D:49:12:9F:D6:2A:2C
03-14 16:45:08.031: W/GameHelper(3839): **** App ID from : 71440642016
03-14 16:45:08.031: W/GameHelper(3839): ****
03-14 16:45:08.031: W/GameHelper(3839): **** Check that the above information matches your setup in
03-14 16:45:08.031: W/GameHelper(3839): **** Developer Console. Also, check that you're logging in with the
03-14 16:45:08.031: W/GameHelper(3839): **** right account (it should be listed in the Testers section if
03-14 16:45:08.031: W/GameHelper(3839): **** your project is not yet published).
03-14 16:45:08.031: W/GameHelper(3839): ****
03-14 16:45:08.031: W/GameHelper(3839): **** For more information, refer to the troubleshooting guide:
03-14 16:45:08.031: W/GameHelper(3839): **** http://developers.google.com/games/services/android/troubleshooting
日志中显示的所有数据都与应用程序中的完全相同。我什至尝试在日志中复制/粘贴数据来创建新的客户端 ID,但我得到了同样的错误。
我还重新阅读了http://developers.google.com/games/services/android/troubleshooting 的故障排除指南,一切似乎都正常。
我也在日志中多次收到以下错误消息。我不确定它是否有任何关系。我用谷歌搜索了它,也无法修复它:
03-14 16:45:01.960: E/GooglePlayServicesUtil(3839): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
更新测试用户需要几个小时吗?自从我添加自己以来,至少有 3 或 4 个。
有什么想法吗?在这一点上我完全没有想法。
唯一相关的代码在我的 onCreate() 方法中:
// Google Play Services
GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
.addApi(Games.API)
.addScope(Games.SCOPE_GAMES)
.build();
mGoogleApiClient.connect();
我也尝试过运行示例应用程序(Type-a-number 挑战),在设置完所有内容后,我得到了同样的错误,即使这些值也与 Google Dev Console 中报告的值相似。
谢谢!
【问题讨论】:
-
您是否尝试过在您的设备上更新 Google 服务? (或者,也许更好,重新安装它?)
-
不,我没有,但如果这是错误,我不能指望用户只为我更新 Google 服务 :)
-
你解决了吗?
-
@GmloMalo 老实说我不记得了。很久以前了。
标签: android google-play-services google-play-games