简体   繁体   English

应用未正确配置为使用 google play 游戏服务

[英]App not correctly configured to use google play game services

I'm using the BaseGameActivity class to connect to google play games services.我正在使用BaseGameActivity类连接到 google play 游戏服务。 The problem is that somehow authentication doesn't work.问题是不知何故身份验证不起作用。 I'm searching the web for a solutions for hours but didn't find anything what helps me solving the problem.我在网上搜索了几个小时的解决方案,但没有找到任何可以帮助我解决问题的方法。

When I start the BaseGameActivity I get the following output in the LogCat:当我启动 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

I checked more than ten times that the Package name, Cert SHA1 fingerprint and App ID (which I starred here) really are identically with those given in https://console.developers.google.com/project/my-app-id/apiui/credential我检查了十多次包名称、证书 SHA1 指纹和应用程序 ID(我在这里加了星)确实与https://console.developers.google.com/project/my-app-id/ 中给出的相同apiui/凭证

I also deleted the client IDs given there several times and recreated them.我还多次删除了那里给出的客户端 ID 并重新创建了它们。 But nothing helps.但没有任何帮助。 Can you help me?你能帮助我吗?

In my case, the SHA1 finger print was incorrect.就我而言,SHA1 指纹不正确。

  1. Go to the Google Play Developer Console, and find your game转到 Google Play Developer Console,找到您的游戏
  2. Go the the "Game Details" tab on the left转到左侧的“游戏详细信息”选项卡
  3. Scroll Down to "API Console Project" and click your "Project Name"向下滚动到“API 控制台项目”并单击您的“项目名称”
  4. Now in the Google Developer Console ( Different Console ), go to API Manager现在在 Google Developer Console(不同的控制台)中,转到 API Manager
  5. Click the Credentials Tab单击凭据选项卡
  6. Under the OAuth 2.0 Client IDs, click your project name在 OAuth 2.0 客户端 ID 下,单击您的项目名称
  7. And now, finally, you can change your SHA1 finger print and/or package name is need be.现在,最后,您可以更改您的 SHA1 指纹和/或包名称。

Your logged in user on the device needs to be a valid tester account.您在设备上登录的用户需要是有效的测试人员帐户。 Check if the logged in user on the device is configured as a valid test user.检查设备上的登录用户是否配置为有效的测试用户。 if not then add the email with which you are logged on to the device to the tester accounts on Google Play Game Developer Console如果没有,则将您登录设备时使用的电子邮件添加到 Google Play 游戏开发者控制台上的测试者帐户

When you install and run the game/app onto your device from eclipse itself, it will not sign in and connect with the google game services.当您从 eclipse 本身将游戏/应用程序安装并运行到您的设备上时,它不会登录并连接到谷歌游戏服务。 Please follow below instructions,请按照以下说明操作,
i.一世。 You have to export the game/app first (Build Project before exporting) ii.您必须先导出游戏/应用程序(导出前构建项目) ii. and upload the app.apk file to device iii.并将 app.apk 文件上传到设备 iii。 Install and run the game/app, you will see the google sign in window.安装并运行游戏/应用程序,您将看到谷歌登录窗口。

did you try this?你试过这个吗? Cert SHA1 fingerprint generated at debug does not match with the keystore I'm using In my case I was testing the app in debug and this certificate was differente at the authorized one. 调试时生成的证书 SHA1 指纹与我使用的密钥库不匹配在我的情况下,我正在调试中测试应用程序,并且此证书与授权证书不同。

Be sure to use the correct SHA1.请务必使用正确的 SHA1。 In my case I had two different debug.keystore files on my PC.就我而言,我的 PC 上有两个不同的debug.keystore文件。

One was located at C:\\User\\myUser\\.android and the other was located at my android-sdk\\.android directory一个位于C:\\User\\myUser\\.android另一个位于我的android-sdk\\.android目录

I used Eclipse and in my case, the debug.keystore was used from the android-sdk directory.我使用了 Eclipse,在我的例子中, debug.keystore是从android-sdk目录中使用的。

If you are using Eclipse you can check the location of the debug.keystore at Window/Preferences/Android/Build/ .如果您使用的是 Eclipse,您可以在Window/Preferences/Android/Build/检查debug.keystore的位置。

None of the above worked for me.以上都不适合我。

You will get this error if your GoogleSignInOptions is invalid, which was my problem.如果您的 GoogleSignInOptions 无效,您将收到此错误,这是我的问题。

For example:例如:

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

Will also give the same error.也会报同样的错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM