应用未正确配置为使用Google Play服务

时间:2014-03-14 22:55:24

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

我已经坚持了好几个小时,似乎没有任何工作。

我有一个简单的游戏,我试图与Google Play服务集成。我有兴趣添加排行榜和一些成就。

这就是我所做的:

  1. MainActivity扩展了BaseGameActivity,我已经导入了BaseGameUtils项目和google-play-services_lib项目。我已将它们都添加为游戏的图书馆项目。

  2. 我已在Google Developers控制台中为我的产品和调试密钥创建了两个客户端ID。

  3. 我在Google Play开发者控制台,游戏服务部分和此应用中添加了我作为测试人员的电子邮件。

  4. 当我运行该应用时,我可以看到Google Play服务对话框,我可以选择一个帐户,我可以看到权限对话框。但是,当我单击“确定”时,我收到以下消息:

    The application is incorrectly configured. Check that the package name and signing certificate match the client ID created in Developer Console. Also, if the application is not yet published, check that the account you are trying to sign in with is listed as a tester account. See logs for more information.
    
  5. 日志说明如下:

    03-14 16:45:08.023: W/GameHelper(3839): **** APP NOT CORRECTLY CONFIGURED TO USE GOOGLE PLAY GAME SERVICES
    03-14 16:45:08.023: W/GameHelper(3839): **** This is usually caused by one of these reasons:
    03-14 16:45:08.023: W/GameHelper(3839): **** (1) Your package name and certificate fingerprint do not match
    03-14 16:45:08.023: W/GameHelper(3839): ****     the client ID you registered in Developer Console.
    03-14 16:45:08.023: W/GameHelper(3839): **** (2) Your App ID was incorrectly entered.
    03-14 16:45:08.023: W/GameHelper(3839): **** (3) Your game settings have not been published and you are 
    03-14 16:45:08.023: W/GameHelper(3839): ****     trying to log in with an account that is not listed as
    03-14 16:45:08.023: W/GameHelper(3839): ****     a test account.
    03-14 16:45:08.023: W/GameHelper(3839): ****
    03-14 16:45:08.023: W/GameHelper(3839): **** To help you debug, here is the information about this app
    03-14 16:45:08.023: W/GameHelper(3839): **** Package name         : com.blabla.myapp
    03-14 16:45:08.031: W/GameHelper(3839): **** Cert SHA1 fingerprint: A9:5C:17:57:0D:74:1A:11:FF:8C:03:B9:7C:8D:49:12:9F:D6:2A:2C
    03-14 16:45:08.031: W/GameHelper(3839): **** App ID from          : 71440642016
    03-14 16:45:08.031: W/GameHelper(3839): ****
    03-14 16:45:08.031: W/GameHelper(3839): **** Check that the above information matches your setup in 
    03-14 16:45:08.031: W/GameHelper(3839): **** Developer Console. Also, check that you're logging in with the
    03-14 16:45:08.031: W/GameHelper(3839): **** right account (it should be listed in the Testers section if
    03-14 16:45:08.031: W/GameHelper(3839): **** your project is not yet published).
    03-14 16:45:08.031: W/GameHelper(3839): ****
    03-14 16:45:08.031: W/GameHelper(3839): **** For more information, refer to the troubleshooting guide:
    03-14 16:45:08.031: W/GameHelper(3839): ****   http://developers.google.com/games/services/android/troubleshooting
    

    日志中显示的所有数据与应用程序中的完全相同。我甚至尝试过复制/粘贴日志中的数据来创建新的客户端ID,我也得到了同样的错误。

    我还重读了http://developers.google.com/games/services/android/troubleshooting的问题排查指南,一切正常。

    我在日志中也会收到以下错误消息。我不确定它是否有任何关系。我用Google搜索了它并且无法解决它:

    03-14 16:45:01.960: E/GooglePlayServicesUtil(3839): The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
    

    更新测试用户需要几个小时吗?自从我加入以来,至少已经有3或4个。

    有什么想法吗?在这一点上,我完全没有想法。

    唯一相关的代码在我的onCreate()方法中:

        // Google Play Services
        GoogleApiClient mGoogleApiClient = new GoogleApiClient.Builder(this)
        .addApi(Games.API)
        .addScope(Games.SCOPE_GAMES)
        .build();
    
    
        mGoogleApiClient.connect();
    

    我还尝试过运行示例应用(Type-a-number challenge),在设置完所有内容之后我得到了相同的错误,即使这些值也与报告的值相似Google Dev Console。

    谢谢!

3 个答案:

答案 0 :(得分:1)

我有同样的问题。我遵循了这个指南

https://developers.google.com/games/services/android/troubleshooting

尽管修改了本指南中的每个主题(如果配置中存在一些错误,这是必要的),问题仍然存在。

要解决它,我清除链接的应用程序,我再次创建它。 但是我没有通过Google Developer Console创建它,而是通过Google Play控制台创建它。因此,对于每个SH1代码,我创建了新的链接应用程序,然后问题解决了

答案 1 :(得分:0)

包ID应与清单xml文件中提到的主要Android应用包相匹配。它必须是主要的应用程序包名称,而不是库包名称。

答案 2 :(得分:0)

我遇到了同样的问题。您需要做的就是仔细检查在开发人员控制台(API)和SHA1中创建的SHA1,同时为您的文件构建APK [最后一步](两者应该完全相同)。如果您正确插入了App ID,它将是相同的。