【发布时间】:2018-06-26 22:44:33
【问题描述】:
我的排行榜无法正常工作。我可以显示我的排行榜,但提交分数无法使用以下代码我试图找出问题所在,我收到 APiException 消息:26502: CLIENT_RECONNECT_REQUIRED强>
mLeaderboardsClient = Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this));
Task<ScoreSubmissionData> task = mLeaderboardsClient.submitScoreImmediate(getString(R.string.leaderboard_id), (long) 67);
task.addOnFailureListener(new OnFailureListener() {
@Override
public void onFailure(@NonNull Exception e) {
if(e instanceof ApiException) {
writeText("dialog", "ApiException: " + e.getMessage());
}else{
writeText("dialog", "Exception: " + e.getMessage());
}
dialog.setVisibility(View.VISIBLE);
}
});
解锁成就和 Google 登录一样有效。我在互联网上没有发现有关此错误消息的任何信息,所以也许有人知道问题可能是什么。我尝试了不同的登录方式,但没有任何帮助。我试图解决这个问题几天,所以如果你有线索或只是知道问题可能是什么,请写信给我。如果您需要更多代码或答案,请随时提出。
【问题讨论】:
-
如果你检查documentation,它说明
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. -
我认为这应该可以解决问题:
if(!mGoogleApiClient.isConnected()) { mGoogleApiClient.reconnect(); }但事实并非如此,我得到了同样的异常。我错了吗? -
您好,有人回答过这个问题吗?如果解决了请发帖。
-
我有同样的问题,请找到解决方案,我正在制作自定义排行榜,卸载并重新安装应用程序有时会解决问题,除了 google play 服务,还有其他可用的排行榜服务吗?这个问题困扰了我两个星期
标签: android google-play-services google-play-games leaderboard