Google Play 服务:帐户没有 SCOPE_GAME_LITE 权限,无法查看排行榜

Google Play Services: Account has no SCOPE_GAME_LITE permissions and cannot view Leaderboard

我按照 https://developers.google.com/games/services/android/signin 上的说明进行操作,可以成功登录并从帐户(如 .getEmail() 等)获取数据。

但是当我尝试显示排行榜时,出现错误: java.lang.IllegalStateException:游戏 API 需要 https://www.googleapis.com/auth/games_lite 函数。

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);
                }
            });

的确如此,

GoogleSignIn.hasPermissions(account, Games.SCOPE_GAMES_LITE));

returns 错误。

Google Play 控制台中的所有内容都应该正确设置。 我也试过 silentSignIn() 但没有成功。

这可能是什么问题?

好的,所以我解决了这个问题... 结果我只需要等待 ~36 小时,所有更改就会生效。

尽管游戏机告诉我所有内容都已发布并可供使用。

所以不要发疯,等着吧。

勾选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.