Reputation: 21
I followed the instructions on https://developers.google.com/games/services/android/signin and can successfully sign in and get data from an account (like .getEmail(), etc).
But when i try to show the leaderboard, i get the error: java.lang.IllegalStateException: Games APIs requires https://www.googleapis.com/auth/games_lite function.
Games.getLeaderboardsClient(this, GoogleSignIn.getLastSignedInAccount(this))
.getLeaderboardIntent(getString(R.string.leaderboard_highscores))
.addOnSuccessListener(new OnSuccessListener<Intent>() {
@Override
public void onSuccess(Intent intent) {
startActivityForResult(intent, RC_LEADERBOARD_UI);
}
});
Indeed,
GoogleSignIn.hasPermissions(account, Games.SCOPE_GAMES_LITE));
returns false.
Everything in the Google Play Console should be set up correctly. I also tried silentSignIn() without success.
What could be the issue here?
Upvotes: 1
Views: 686
Reputation: 2987
Check Troubleshooting Issues in Your Android Game : Anonymous listeners
Do not use anonymous listeners. Anonymous listeners are unreliable because the Play Games SDK maintains them as weak references, which means that they might be reclaimed by the garbage collector before they are invoked. Instead, you should implement the listener using a persistent object such as the Activity.
Upvotes: 0
Reputation: 21
Ok, so i solved the issue... Turns out i only had to wait for ~36h for all the changes to take effect.
This was even though the game console told me that everything was published and ready to use.
So don't get crazy and just wait.
Upvotes: 1