Play游戏服务成就活动立即关闭

Play游戏服务成就活动立即关闭

本文介绍了Google Play游戏服务成就活动立即关闭的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将我的游戏更新为新的Google Play服务库,排行榜和成就已经完美运行,但现在,当我尝试打开成就活动时,它立即关闭,而不会在logcat中显示任何异常。
我使用我的Google帐户登录,该帐户已正确配置为测试用户。

  public void gameServicesGetAchievements (){
if(gameHelper == null)
return;

意图i = Games.Achievements.getAchievementsIntent(gameHelper.getApiClient());
((Activity)ctx).startActivityForResult(i,REQUEST_CODE_ACHIEVEMENTS);
}

活动打开,但在显示成就列表之前立即关闭。这就是我在logcat中得到的结果

  D / GameHelper(30459):GameHelper:onActivityResult:req = 9802,resp = RESULT_RECONNECT_REQUIRED 
D / GameHelper(30459):GameHelper:onActivityResult:请求代码不适合我们。忽略。

我试着在我的onActivityResult中处理RESULT_RECONNECT_REQUIRED代码,但没有任何变化。

  @Override 
public void onActivityResult(int request,int response,Intent data){
super.onActivityResult(request,response,data );

GameHelper helper = resolver.getGameServicesHelper();
if(helper!= null){
helper.onActivityResult(request,response,data);
}

if(response == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED){
helper.disconnect();
}
}

排行榜活动正确开始并且工作完美无瑕。解决方案

发现问题...在我的应用中这不是问题,只是我的设备上的Google Play游戏应用有一些问题损坏的数据或其他东西。
我按照这里的步骤来修复它。




  • 先导航至设置>应用,然后在Google上找到并点按玩
    游戏。

  • 然后点击卸载更新,然后点按清除数据。

  • 然后返回
    到应用部分并找到Google Play服务,点按然后点击
    管理空间,然后点击清除所有数据。

  • 现在您只需购买
    即可进入Play商店并手动更新Google Play游戏。


I'm updating my game to the new Google Play Serviced library, leaderboards and achievements were already working flawlessly, but now when I try to open the achievement activity, it immediately closes without showing any exception in logcat.I'm logged in with my google account, which is correctly configured as a test user.

public void gameServicesGetAchievements() {
    if (gameHelper == null)
        return;

    Intent i = Games.Achievements.getAchievementsIntent(gameHelper.getApiClient());
    ((Activity) ctx).startActivityForResult(i, REQUEST_CODE_ACHIEVEMENTS);
}

The activity opens, but closes immediately before showing the achievements list. This is what I get in logcat

D/GameHelper(30459): GameHelper: onActivityResult: req=9802, resp=RESULT_RECONNECT_REQUIRED
D/GameHelper(30459): GameHelper: onActivityResult: request code not meant for us. Ignoring.

I tried handling the RESULT_RECONNECT_REQUIRED code in my onActivityResult, but nothing changes.

@Override
public void onActivityResult(int request, int response, Intent data) {
    super.onActivityResult(request, response, data);

    GameHelper helper = resolver.getGameServicesHelper();
    if (helper != null) {
        helper.onActivityResult(request, response, data);
    }

    if (response == GamesActivityResultCodes.RESULT_RECONNECT_REQUIRED) {
        helper.disconnect();
    }
}

The leaderboards activities start correctly and work flawlessly.

解决方案

Found the problem... it wasn't a problem in my app, just the Google Play Games app on my device had some corrupted data or something.I followed the steps here and that fixed it.http://howlukeseesit.blogspot.it/2014/08/fixing-google-play-games.html

  • First navigate to settings > apps and find and tap on Google playgames.
  • Next tap uninstall updates, then tap clear data.
  • Next go backto the apps section and find Google Play Services, tap that then tapManage space and then tap on clear all data.
  • Now all you have to dois go into the Play store and manually update Google Play Games.

这篇关于Google Play游戏服务成就活动立即关闭的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-25 22:37