當前嘗試將我的遊戲(使用libgdx)連接到Google遊戲服務以啓用排行榜/成就等,並看到一些奇怪的行爲。Google遊戲服務登錄問題(第一次嘗試失敗,成功第二次)
問題
當我在「登錄」第一挖掘,它顯示的對話框中選擇你的谷歌賬戶,然後播放服務許可界對話,那麼大的負載循環。一段時間後,它會顯示與谷歌以下錯誤未知問題的對話播放服務
如果我點擊「確定」取消該錯誤對話框,然後輕按「登錄」按鈕,再次,我立即得到成功登錄之後,我可以看到排行榜等
詳細
的錯誤日誌我看到:
...
D: GameHelper: onActivityResult: req=RC_RESOLVE, resp=9001
D: GameHelper: onAR: responseCode=9001, so giving up.
D: GameHelper: killConnections: killing connections.
D: GameHelper: killConnections: all clients disconnected.
D: GameHelper: State change CONNECTING -> DISCONNECTED
D: GameHelper: Making error dialog for failure: SignInFailureReason(serviceErrorCode:SIGN_IN_REQUIRED(4),activityResultCode:9001)
D: GameHelper: Showing error dialog.
D: GameHelper: Notifying LISTENER of sign-in FAILURE (error)
I: ----- Sign in failed :(-----
///// Tap the 'sign in' button again ///////
I: ----- Begin sign in process... -----
D: GameHelper: Starting USER-INITIATED sign-in flow.
D: GameHelper: isGooglePlayServicesAvailable returned 0
D: GameHelper: beginUserInitiatedSignIn: starting new sign-in flow.
D: GameHelper: Starting connections.
D: GameHelper: State change DISCONNECTED -> CONNECTING
D: GameHelper: connectNextClient: requested clients: 1, connected clients: 0
D: GameHelper: Pending clients: 1
D: GameHelper: Connecting GamesClient.
D: GameHelper: onConnected: connected! client=1
D: GameHelper: Connected clients updated to: 1
D: GameHelper: connectNextClient: requested clients: 1, connected clients: 1
D: GameHelper: Pending clients: 0
D: GameHelper: All clients now connected. Sign-in successful!
D: GameHelper: All requested clients connected. Sign-in succeeded!
D: GameHelper: State change CONNECTING -> CONNECTED
D: GameHelper: Notifying LISTENER of sign-in SUCCESS
I: ----- Sign in success! -----
D: GameHelper: onActivityResult: req=3, resp=3
D: GameHelper: onActivityResult: request code not meant for us. Ignoring.
...
由於我使用libgdx,我不延長BaseGameActivity
相反,我手動創建GameHelper
和使用,而不是
// in @Override onCreate:
mGameHelper = new GameHelper(this);
mGameHelper.setup(this, GameHelper.CLIENT_GAMES);
mGamesClient = mGameHelper.getGamesClient();
// in @Override onStart:
mGameHelper.onStart(this);
// then, for the sign in button, using it:
mGameHelper.beginUserInitiatedSignIn();
額外的信息
我也看到了下面的日誌:
E: The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
然而,不知道這是否是相關的,因爲從我」已經閱讀,這似乎與地圖/ GPS /位置有關。不使用的地圖,我能夠登錄,所以不知道這個錯誤是相關或不
更新/編輯(儘管它聽起來很糟糕!):經過測試,這個錯誤是造成由AdMob(我已經與谷歌服務集成)。雖然錯誤聽起來很糟糕,但禁用AdMob(沒有更多的錯誤),奇怪的行爲仍然是一樣的。
我認爲下面是有趣的錯誤日誌,雖然沒有太多的運氣谷歌搜索此錯誤:
E/dalvikvm(2618): Could not find class 'android.app.AppOpsManager', referenced from method axo.a
編輯2:更多的發現!
即使我沒有瀏覽整個登錄工作流程,我也會得到相同的錯誤對話框。
- 點擊「登錄」
- 帳戶查看列表登錄到
- 點擊「取消」
- 看到一個標題/信息提示對話框:與谷歌未知問題上發揮服務
任何幫助將是偉大的!
注:
- 這可以穩定地再生 - 註銷,以上
- 確信我打電話
onActivityResult
被描述爲在Google Play Game Services: strange sign in behavior 建議在登錄按鈕兩個水龍頭給人的行爲
- 瀏覽本教程並設置示例應用程序(Type A Number) - 並且一切正常。