2014-04-25 99 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

非常感謝! –