我有一个使用谷歌地图Android v2 API的应用程序。我已经添加了google-play-services_lib库项目到我的工作空间,并从我的应用程序项目中添加了对它的引用,按照这些页面上的说明:

http://developer.android.com/google/play-services/setup.html。 https://developers.google.com/maps/documentation/android/start

一切似乎都很正常:应用程序显示地图和覆盖默认标记。所以我很确定我已经正确地设置了谷歌播放服务和谷歌地图API。

然而,我在ADT LogCat窗口中看到这条消息每当地图视图初始化(在第二代Nexus 7上):

The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.

消息级别是Error,标记是GooglePlayServicesUtil。

这似乎是良性的,因为我的应用程序运行良好。但是我能做些什么来解决问题呢?


进一步的信息:每次“谷歌播放服务资源未找到”消息出现在LogCat中,它前面是这些消息,这是警告和标记ResourceType:

getEntry failing because entryIndex 906 is beyond type entryCount 3

Failure getting entry for 0x7f0b038a (t=10 e=906) in package 0 (error -2147483647)

FWIW,当我搜索项目时,我找不到常量0x7f0b038a,包括gen/R.java文件。

我检查了生成的.apk的内容,它包括了google-play-services_lib/res目录下的所有资源。


另一个更新:添加ActionBarSherlock和更新targetSdkVersion在我的清单从8到17,我现在看到另一个错误在LogCat输出:

Could not find class 'maps.af.k', referenced from method 'maps.ag.an.a'

关于这个问题的更多细节可以在这里找到:谷歌地图在Android上工作正常,但我仍然得到一个错误“无法找到类的Maps . I。K ',引用自方法maps.z.ag.a"

这款应用似乎又一次运行良好。也许忽略这些“错误”是安全的?


当前回答

对我来说,唯一可行的解决方案是添加android-support-v7-appcompat库。为了消除该消息,似乎还需要这个库。从那时起,我的应用程序一直工作得很好!

我希望这能有所帮助!

其他回答

在与其他开发者合作时,我也遇到了同样的问题。如果我从我的ADT运行项目,它工作得很好,但从他们的不是。

答案是把他们的SHA-1密钥和包名放在谷歌API控制台和我的控制台中。我们是三个开发人员,所以我们需要输入三个SHA-1密钥。

我希望它能给你一些启发……

You know, I don't think it's a bug from sdk. "The Google Play services resources were not found. Check your project configuration to ensure that the resources are included" is exactly right. The jar file putted into your /libs doesn't contain any resources like *xml, *png etc. The error logs mean this. And If your ever added support libraries like v4, v7-appcompat, v7-cardview, v7-recyclerview, v7-pallete or v7-gridlayout, sometimes logs which imply that resources are in short occur. All these is because that resources in projects are not imported. So, import support projects as library ASAP. Of course, you first download this support projects through SDK Manager at the item of extras

我也有同样的问题。我也试图寻找解决方案,但在我没有找到任何解决方案后,我试图重新启动我的移动设备(Android设备),它解决了这个问题。

请试一试!为了安全起见,重新启动您的移动设备和Eclipse,并检查它是否正常工作。

您必须将google-play-services-lib添加为库项目。他们更新了SDK。这里有一些教程。对于Eclipse来说很简单:

Right click project -> properties -> Android

有关更详细的演练:

导入库项目

如何让GoogleMaps在模拟器上运行

这是谷歌播放服务库中的一个错误,它在第755号问题下提交。

不幸的是,目前还没有任何解决方案。