Android工作室 - Google Play游戏服务登录失败

时间:2015-11-10 12:24:32

标签: android android-studio google-play-services google-play-games

我知道,这个问题已经存在于许多形状中,但我仍然无法解决我的问题。 问题是,当我运行我的应用程序并尝试使用Google Play游戏服务登录时,它会向我显示以下消息:

“应用程序配置不正确。请检查程序包名称和签名证书是否与Developer Console中创建的客户端ID匹配。此外,如果应用程序尚未发布,请检查您尝试登录的帐户被列为测试人员帐户。有关详细信息,请参阅日志。“

我已经尝试过:

  • 确保我的AndroidManifest.xml上的包名称正确
  • 检查了我的SHA1并与我的链接应用的SHA1进行了比较(甚至创建了一个具有相同SHA1的新版本,以确保无效)
  • 将我的Google+帐户添加到了测试人员列表
  • 写了代码:

    机器人:名称= “com.google.android.gms.version”         机器人:值= “@整数/ GOOGLE_PLAY_SERVICES_VERSION”

在我的字符串值中使用正确的ID

但错误仍然没有解决。现在我只是认为这个问题很少出现在代码段上:

android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />

但是我无法找到这个值来检查它(我正在研究一个libgdx项目,并且google_play_service包不在我的项目层次结构中,但其他一切正常)。不确定这可能是我的问题,我还能做些什么?

2 个答案:

答案 0 :(得分:0)

如果您正在测试应用,请务必从调试证书开始。

总结:当您应该使用调试SHA时,通常会发生这种情况,而是使用链接应用的发布信息(授权您的应用时在Google Play开发者控制台中填写的部分)。

你可能已经知道了很多,但是:

点击Android Studio最右侧的垂直Gradle标签,转到Gradle View。

enter image description here

或者您可以使用菜单打开它:查看>工具窗口>摇篮

当Gradle View打开时,它将如下所示:

enter image description here

双击上面蓝色突出显示的名为signingReport的部分(位于:app / Tasks / android)。

这将通常在Android Studio的“运行”窗格中运行一个signingReport(位于界面的底部,通常是默认使用Android监视器的位置)。您可以通过复制您自己的signingReport上的行来获取调试SHA1,其中我在下图中以红色表示的位置(除了我的省略号之外的SHA1的示例如下所示):

cf:23:df:22:07:d9:9a:74:fb ...

enter image description here

然后,当您要求提供SHA1时,您会将其粘贴到Google Play开发者控制台的链接应用部分中。

您是否已经创建了调试APK?如果你没有,那么你可能需要注意的其他事情:

http://developer.android.com/tools/publishing/app-signing.html#studio

您可以像发布APK一样创建调试APK,但在上面链接的最后一步,选择调试,而不是发布。

另外,请看一下有关您可能偏离其他地方的一般想法:Google Play Game Services : Debug AND Release certificate

尤其如果您使用Google Developer Console而非Google Play 开发者控制台。

答案 1 :(得分:0)

我遇到了此错误(从Google Games serivces控制台导出ids.xml之后,我通过以下方式解决了该问题:

  1. 为游戏启用详细日志记录:
adb shell setprop log.tag.Games VERBOSE

然后我使错误发生了并得到了这个错误:

2019-07-25 20:30:20.189 2241-28188/? E/SignInAuthenticator: ****
    **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
    **** This is usually caused by one of these reasons:
    **** (1) Your package name and certificate fingerprint do not match
    ****     the client ID you registered in Developer Console.
    **** (2) Your App ID was incorrectly entered.
    **** (3) Your game settings have not been published and you are 
    ****     trying to log in with an account that is not listed as
    ****     a test account.
    ****
    **** To help you debug, here is the information about this app
    **** Package name         : com.my.package.name
    **** Cert SHA1 fingerprint: AB:CD:EF:12:34:56:78:90:....
    **** App ID from manifest : 1234567890123
    ****
    **** Check that the above information matches your setup in 
    **** Developer Console. Also, check that you're logging in with the
    **** right account (it should be listed in the Testers section if
    **** your project is not yet published).
    ****
    **** For more information, refer to the troubleshooting guide:
    ****   http://developers.google.com/games/services/android/troubleshooting
    ****

从错误消息中复制哈希,然后转到Google Play服务控制台。

  1. 点击游戏服务
  2. 点击您的游戏
  3. 点击链接的应用
  4. 链接另一个应用程序
  5. 点击Android
  6. 填写详细信息
  7. 点击保存并继续
  8. 在弹出的框中,从上方粘贴SHA1哈希
  9. 单击“保存”,然后发布更改
相关问题