【问题标题】:Google Play Services: Account has no SCOPE_GAME_LITE permissions and cannot view LeaderboardGoogle Play 服务:帐户没有 SCOPE_GAME_LITE 权限,无法查看排行榜
【发布时间】:2017-12-19 00:07:52
【问题描述】:

我按照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));

返回假。

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

这可能是什么问题?

【问题讨论】:

  • 简短更新:我正在使用选项“DEFAULT_SIGN_IN”创建 googleSignInClient。切换到“DEFAULT_GAMES_SIGN_IN”时,我无法再登录。但是,当首先使用 DEFAULT_SIGN_IN 编译,然后使用带有“DEFAULT_GAMES_SIGN_IN”的 SilentSignIn 时,会授予 SCOPE_GAMES_LITE 权限。仍然无法显示排行榜...
  • Google Play Games的可能重复

标签: android google-play-games


【解决方案1】:

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

即使游戏机告诉我所有内容都已发布并可以使用。

所以不要发疯,等待。

【讨论】:

    【解决方案2】:

    查看Troubleshooting Issues in Your Android Game : Anonymous listeners

    不要使用匿名侦听器。匿名听众不可靠 因为 Play Games SDK 将它们维护为弱引用,这 意味着它们可能会在之前被垃圾收集器回收 它们被调用。相反,您应该使用 持久性对象,例如 Activity。

    【讨论】:

      猜你喜欢
      • 2019-02-21
      • 2013-06-12
      • 2023-04-03
      • 1970-01-01
      • 1970-01-01
      • 2021-08-11
      • 2014-12-19
      • 1970-01-01
      • 2019-10-10
      相关资源
      最近更新 更多