問題描述
Android Google Play 遊戲服務 (Android Google Play Games Services)
正在嘗試將 google play 遊戲排行榜集成到 android 應用程序中。
Google API 客戶端連接成功。我得到的結果代碼為 ‑1,這不過是 RESULT_OK。
但是當我在我的活動結果中使用排行榜意圖調用 google 排行榜 api 時,我得到 10001,它代表不一致的狀態,即 RESULT_RECONNECT_REQUIRED。即使在調用意圖之前我正在檢查谷歌 api 客戶端是否已連接。每次都返回 true。
無法理解可能導致此問題的原因。
參考解法
方法 1:
hope this may help you in solving your problem:
https://code.tutsplus.com/tutorials/google‑play‑game‑services‑leaderboards‑‑cms‑20700
方法 2:
These links will help u in, Overview : https://code.tutsplus.com/tutorials/google‑play‑game‑services‑achievements‑‑cms‑20591. Integration :https://code.tutsplus.com/tutorials/integrating‑google‑play‑services‑on‑android‑‑cms‑19828. If you are not satisfied refer this link,https://coronalabs.com/blog/2013/06/25/tutorial‑introducing‑google‑play‑game‑services/
方法 3:
According to the documentation, RESULT_RECONNECT_REQUIRED is sent back to the calling Activity when a reconnect is required.
The GoogleApiClient is in an inconsistent state and must reconnect to the service to resolve the issue. Further calls to the service using the current connection are unlikely to succeed.
To handle it call googleApiClient.reconnect() and onConnected() will be called when the client is connected again.
方法 4:
The reason you might get that code is because app is not linked. So on play games developer console linked my application and it started to work.
(by Pritam Kadam、Varma460、Ashwin Elangovan、Clayton Wilkinson、Pritam Kadam)