【问题标题】:App not correctly configured to use google play game services应用程序未正确配置为使用 google play 游戏服务
【发布时间】:2014-04-25 19:40:36
【问题描述】:

我正在使用 BaseGameActivity 类连接到 google play 游戏服务。问题是某种身份验证不起作用。我在网上搜索了几个小时的解决方案,但没有找到任何可以帮助我解决问题的方法。

当我启动 BaseGameActivity 时,我在 LogCat 中得到以下输出:

03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
03-19 14:22:36.126: W/GameHelper(15312): **** This is usually caused by one of these reasons:
03-19 14:22:36.126: W/GameHelper(15312): **** (1) Your package name and certificate fingerprint do not match
03-19 14:22:36.126: W/GameHelper(15312): ****     the client ID you registered in Developer Console.
03-19 14:22:36.126: W/GameHelper(15312): **** (2) Your App ID was incorrectly entered.
03-19 14:22:36.126: W/GameHelper(15312): **** (3) Your game settings have not been published and you are 
03-19 14:22:36.126: W/GameHelper(15312): ****     trying to log in with an account that is not listed as
03-19 14:22:36.126: W/GameHelper(15312): ****     a test account.
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** To help you debug, here is the information about this app
03-19 14:22:36.126: W/GameHelper(15312): **** Package name         : *****
03-19 14:22:36.126: W/GameHelper(15312): **** Cert SHA1 fingerprint: *****
03-19 14:22:36.126: W/GameHelper(15312): **** App ID from          : *****
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** Check that the above information matches your setup in 
03-19 14:22:36.126: W/GameHelper(15312): **** Developer Console. Also, check that you're logging in with the
03-19 14:22:36.126: W/GameHelper(15312): **** right account (it should be listed in the Testers section if
03-19 14:22:36.126: W/GameHelper(15312): **** your project is not yet published).
03-19 14:22:36.126: W/GameHelper(15312): ****
03-19 14:22:36.126: W/GameHelper(15312): **** For more information, refer to the troubleshooting guide:
03-19 14:22:36.126: W/GameHelper(15312): ****   http://developers.google.com/games/services/android/troubleshooting

我检查了十多次,包名、Cert SHA1 指纹和 App ID(我在这里加了星号)确实与 https://console.developers.google.com/project/my-app-id/apiui/credential 中给出的相同

我还多次删除了那里提供的客户端 ID,然后重新创建了它们。但没有任何帮助。你能帮帮我吗?

【问题讨论】:

  • 您是使用调试密钥(默认)签署应用程序,还是使用生产密钥导出?
  • 我都尝试了,并且还在开发者控制台中为这两个键创建了客户端 ID。

标签: java android google-api google-play-services google-play-games


【解决方案1】:

您在设备上的登录用户必须是有效的测试人员帐户。 检查设备上的登录用户是否配置为有效的测试用户。如果没有,则将您用于登录设备的电子邮件添加到 Google Play 游戏开发者控制台上的测试人员帐户

【讨论】:

  • 我的登录用户是测试员帐户,我已经发布了该应用程序。所以这不可能是问题的原因。
【解决方案2】:

当您从 eclipse 本身在您的设备上安装并运行游戏/应用程序时,它不会登录并连接到 google 游戏服务。请按照以下说明进行操作,
一世。您必须先导出游戏/应用程序(导出前构建项目) ii.并将 app.apk 文件上传到设备 iii.安装并运行游戏/应用程序,您将看到 google 登录窗口。

【讨论】:

    【解决方案3】:

    你试过了吗? Cert SHA1 fingerprint generated at debug does not match with the keystore I'm using 在我的情况下,我正在调试应用程序,并且此证书与授权证书不同。

    【讨论】:

      【解决方案4】:

      请务必使用正确的 SHA1。就我而言,我的 PC 上有两个不同的 debug.keystore 文件。

      一个位于C:\User\myUser\.android,另一个位于我的android-sdk\.android 目录

      我使用的是 Eclipse,在我的例子中,debug.keystore 是从 android-sdk 目录中使用的。

      如果您使用的是 Eclipse,您可以在Window/Preferences/Android/Build/ 上查看debug.keystore 的位置。

      【讨论】:

        【解决方案5】:

        在我的例子中,SHA1 指纹不正确。

        1. 转到 Google Play 开发者控制台,找到您的游戏
        2. 转到左侧的“游戏详情”标签
        3. 向下滚动到“API 控制台项目”并点击您的“项目名称”
        4. 现在在 Google Developer Console(不同的控制台)中,转到 API Manager
        5. 单击凭据选项卡
        6. 在 OAuth 2.0 客户端 ID 下,点击您的项目名称
        7. 现在,您终于可以更改您的 SHA1 指纹和/或包名称了。

        【讨论】:

          【解决方案6】:

          以上都不适合我。

          如果您的 GoogleSignInOptions 无效,您将收到此错误,这是我的问题。

          例如:

          GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_GAMES_SIGN_IN).
                  requestServerAuthCode("AN INVALID CLIENT ID").
                  build();
          

          也会报同样的错误。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2014-11-14
            • 2014-04-20
            • 2014-06-21
            • 2015-05-08
            • 1970-01-01
            • 2013-05-27
            • 1970-01-01
            相关资源
            最近更新 更多