android – Google Play游戏服务成就活动立即关闭
作者:互联网
我正在将我的游戏更新到新的Google Play服务库,排行榜和成就已经完美无缺,但现在当我尝试打开成就活动时,它会立即关闭而不会在logcat中显示任何异常.
我已使用我的Google帐户登录,该帐户已正确配置为测试用户.
public void gameServicesGetAchievements() {
if (gameHelper == null)
return;
Intent 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: request code not meant for us. Ignoring.
我尝试在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游戏应用程序有一些损坏的数据或其他东西.
我按照这里的步骤修复了它.
http://howlukeseesit.blogspot.it/2014/08/fixing-google-play-games.html
>首先导航到设置>应用并查找并点按Google Play
游戏.
>接下来点击卸载更新,然后点按清除数据.
>接下来回去吧
到应用部分找到Google Play服务,点击然后点按
管理空间,然后点击清除所有数据.
>现在你需要做的一切
进入Play商店并手动更新Google Play游戏.
标签:android,google-play-services,google-play-games 来源: https://codeday.me/bug/20190830/1768837.html