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.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…