应用未正确配置为与libgdx游戏一起使用Google Play服务 [英] App not correctly configured to use Google Play services with a libgdx game

查看:183
本文介绍了应用未正确配置为与libgdx游戏一起使用Google Play服务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们使用Libgdx开发了一个游戏,我正在尝试将其与Google Play服务集成.我有兴趣添加Google多人游戏服务.

We develop a game using Libgdx which I'm trying to integrate with Google Play services. I'm interested in adding google multiplayer service.

这就是我所做的:

MainActivity扩展了BaseGameActivity,并且我已经导入了BaseGameUtils项目和google-play-services_lib项目.我已经将它们都添加为游戏的图书馆"项目.

MainActivity extends BaseGameActivity, and I've imported the BaseGameUtils project and the google-play-services_lib projects. I've added them both as Library projects of the game.

我已经在Google Developers控制台中为我的产品和调试键创建了两个客户端ID.

I've created two client IDs in Google Developers console for both my product and my debug keys.

我已将电子邮件作为测试者添加到Google Play开发者控制台,游戏服务"部分以及该应用程序中.

I added my email as a tester in the Google Play Developer console, in the Game Services section and for this app.

运行该应用程序时,可以看到Google Play服务对话框,还可以选择一个帐户,还可以看到权限对话框.但是,当我单击确定"时,会收到以下消息:

When I run the app, I can see the Google Play services dialog, and I can select an account and I can see the permissions dialog. However when I click Ok I get the following message:

该应用程序配置不正确.检查程序包名称和签名证书是否与在开发人员控制台中创建的客户端ID匹配.另外,如果该应用程序尚未发布,请检查您尝试登录的帐户是否已列为测试者帐户.请参阅日志以获取更多信息. 日志显示以下内容:

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. The logs say the following:

09-20 16:20:36.153: W/GameHelper(3989): disconnect() called when client was already disconnected.
09-20 16:20:36.153: W/GameHelper(3989): ****
09-20 16:20:36.153: W/GameHelper(3989): ****
09-20 16:20:36.153: W/GameHelper(3989): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME                                                         SERVICES
09-20 16:20:36.153: W/GameHelper(3989): **** This is usually caused by one of these reasons:
09-20 16:20:36.153: W/GameHelper(3989): **** (1) Your package name and certificate fingerprint do     not match
09-20 16:20:36.154: W/GameHelper(3989): ****     the client ID you registered in Developer Console.
09-20 16:20:36.154: W/GameHelper(3989): **** (2) Your App ID was incorrectly entered.
09-20 16:20:36.154: W/GameHelper(3989): **** (3) Your game settings have not been published and you are 
09-20 16:20:36.154: W/GameHelper(3989): ****     trying to log in with an account that is not listed as
09-20 16:20:36.154: W/GameHelper(3989): ****     a test account.
09-20 16:20:36.154: W/GameHelper(3989): ****
09-20 16:20:36.154: W/GameHelper(3989): **** To help you debug, here is the information about this app
09-20 16:20:36.154: W/GameHelper(3989): **** Package name         : com.beh.sheepy
09-20 16:20:36.159: W/GameHelper(3989): **** Cert SHA1 fingerprint:     XX:XX:XX:XX:XX:C4:B5:4D:81:A5:16:6C:11:51:E5:FD:F3:35:08:46
09-20 16:20:36.159: W/GameHelper(3989): **** App ID from          : XXXXXXXXXX
09-20 16:20:36.159: W/GameHelper(3989): ****
09-20 16:20:36.159: W/GameHelper(3989): **** Check that the above information matches your setup in 
09-20 16:20:36.159: W/GameHelper(3989): **** Developer Console. Also, check that you're logging in with the
09-20 16:20:36.159: W/GameHelper(3989): **** right account (it should be listed in the Testers section if
09-20 16:20:36.159: W/GameHelper(3989): **** your project is not yet published).
09-20 16:20:36.159: W/GameHelper(3989): ****
09-20 16:20:36.159: W/GameHelper(3989): **** For more information, refer to the troubleshooting guide:
09-20 16:20:36.159: W/GameHelper(3989): ****                                           http://developers.google.com/games/services/android/troubleshooting

更新测试用户可能需要几个小时吗?自从我添加自己以来已经至少24岁了.

Can updating the test users take several hours? It's been at least 24 since I added myself.

有什么想法吗?在这一点上,我完全没有主意.

Any ideas? I'm totally out of ideas at this point.

唯一相关的代码在我的onCreate()方法中:

The only related code is in my onCreate() method:

if (gameHelper == null) {
        gameHelper = new GameHelper(this, GameHelper.CLIENT_GAMES);
        gameHelper.enableDebugLog(true);
        }
        gameHelper.setup(this);

我已经检查了SHA1编号,客户ID,并且我们的电子邮件在测试人员的列表中.我们还会尝试故障排除指南: https://developers.google.com/games/services/android/troubleshooting ,但仍然无法正常工作...

I've checked the SHA1 number, the client ID, and our email is in the tester's list. We also try the troubleshooting guide: https://developers.google.com/games/services/android/troubleshooting but it still not working...

谢谢!

推荐答案

最后,它是可行的!我在Google Play开发者控制台中删除了该项目,然后重做了所有操作.我还注意到,我正在使用的gmail帐户的google +未被激活.也许这就是为什么它第一次不起作用的原因……希望能对遇到同样问题的人有所帮助.

Finally, it's works !! I deleted the project in google play developer console and I redid all. I also notice that the google+ of the gmail account I was using was not actived. Maybe this is why it didn't work the first time... Hope that will help someone with the same issue.

这篇关于应用未正确配置为与libgdx游戏一起使用Google Play服务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆