0

I've been trying to get the game services working properly for so long. My problem is that game service isn't working on the version downloaded from the play store, but on the version downloaded directly from android studio the game service works perfectly. Even though both versions use the same key and have the same SHA1 code (the release SHA1 code). I checked if the SHA1 from the play store version of my app matches with the game service's SHA1 by comparing the SHA1 codes from the android-release.apk and from https://console.developers.google.com/apis/credentials/oauthclient. I doubt that the problem lies in the code of my app, because it works perfectly in the version downloaded directly from android studio.

So my question is what I could have possibly done wrong here, and how to fix it.

Thank you for reading

4

3 回答 3

1

首先,我要感谢所有花时间发布答案的人。我认为没有人会猜到我的愚蠢错误,因为它仅适用于 libGDX 用户。问题是 BaseGameUtils 的 gradle .build 文件中的目标 sdk 与 android 模块的 .build 文件不同。令人惊讶的是,这么小的一个错误会花费你整个周末的时间!

于 2017-06-07T15:07:36.677 回答
0

使用 Google Play 服务 SDK 时,请检查并确保您的设备也兼容并运行 Android 4.0 或更高版本并包含 Google Play 商店。

有关详细信息,请参阅此文档。而且,本文讨论了将 Google Play 服务与您的 Android 操作系统版本匹配的问题,也可能会有所帮助

于 2017-05-23T12:11:04.757 回答
-1

我有同样的问题:

你需要使用这个:

keytool -exportcert -keystore path-to-debug-or-production-keystore -list -v

例子:

keytool -exportcert -keystore D:\Hristijan\Aplikacii\Keystore\blabla.jks -list -v

这是您在构建 APK 文件时创建密钥库的路径。

问题是我们在 OAuth 2.0 客户端 ID 中使用 SHA1 密钥进行调试,据我了解,用于调试和发布的 SHA1 是不同的。

因此,在您获得发布版的 SHA1 后,您可以访问谷歌云平台并在 Credentials 中更改您的应用程序的 SHA1。

于 2017-05-23T00:40:29.170 回答