2014-04-25 101 views
3

我已经按照教程中的每一步,做了一切。现在,当我跑我的应用程序,谷歌的游戏登录出现并开始登录,但几分钟后,我得到这个对话框AndEngine无法登录谷歌播放服务

enter image description here

我注意到,当我运行使用Eclipse我的应用程序直接,我收到了Sha1 key这从67:xxxxxx开始,当我输出我的.apk然后运行时,我得到一个不同的sha1 key,以B4:xxxxx开头。

我已将sha1 keys添加到我的开发者控制台,但仍会出现此对话框。

请注意,在开发人员控制台的项目概述中,我可以看到5个请求和5个错误。

清单代码:

<meta-data android:name="com.google.android.gms.games.APP_ID" 
    android:value="@string/app_id" /> 
<meta-data android:name="com.google.android.gms.version" 
    android:value="@integer/google_play_services_version"/> 

logcat的

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.xxx.xx 
03-14 16:45:08.031: W/GameHelper(3839): **** Cert SHA1 fingerprint: xxxxxxxxxxxxxxxxxxxxxxxx 
03-14 16:45:08.031: W/GameHelper(3839): **** App ID from   : xxxxxxx 
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 

另外,我不知道这有什么关系呢,但我得到这个太

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. 

我跟着这个问题:http://dola-software.tk/implementing-google-play-game-services-leaderboards-and-achievements-in-andengine-game/

+0

您确定您已将正确的'R'类导入BaseGameUtils类吗? – d3dave

+0

当您从eclipse运行应用程序时,apk使用调试密钥库进行签名。当apk导出时,它使用发行密钥库进行签名。因此,SHA1的差异。尝试从eclipse运行,并确保复制此命令生成的SHA1:'$ keytool -exportcert -alias androiddebugkey -keystore〜/ .android/debug.keystore -list -v'。让我知道它是否有效。 –

+0

两个SHA1都添加到相同的客户端ID吗?你可以尝试将它们添加到不同的客户端ID吗? –

回答

1

根据你的评论中共享的image,我相信你正在使用Google Developers Console来生成客户端ID。 应该使用Google Play Developer Console来生成客户端ID。

请按照此documentation生成OAuth 2.0客户端ID。以下是该文档中提到的注释之一:

警告:请勿从Google 开发人员控制台为您的游戏创建新的客户端ID。如果你这样做,玩游戏服务不会 将你的游戏设置与客户端ID相关联,这可能会导致游戏过程中出现 错误。

+0

非常感谢! –