java - 应用未正确配置为使用 Google Play 游戏服务

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

我正在使用 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

我检查了十多次,Package name、Cert SHA1 fingerprint 和 App ID(我在此处加星标)确实与 https://console.developers.google.com/project/my-app-id/apiui/credential 中给出的相同。

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

最佳答案

就我而言,SHA1 指纹不正确。

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

关于java - 应用未正确配置为使用 Google Play 游戏服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22507927/

相关文章:

java - 使用自定义 ListView 时出错

android - 有什么方法可以用 spannable 替换 EditText 中的文本,但可以节省值(value)?

java - 如何在 ViewPager Fragment 中更改 View

xml - 使用 Google 地理编码 API 进行 VBA 编程

javascript - 在 Google 日历中保持签名状态

google-api - Google Drive 使用导出 api 下载文件

java - Java 中的轻量级消息传递(异步调用)

java - Eclipse - 在多个文件之间跳转的一般用法

java - 如何通过java在android中制作动画

安卓工作室 : Failure [INSTALL_FAILED_OLDER_SDK]