相关疑难解决方法(0)

LogCat消息:找不到Google Play服务资源.检查项目配置以确保包含资源

我有一个使用Google Maps Android v2 API的应用程序.我已将google-play-services_lib库项目添加到我的工作区,并根据这些页面上的说明从我的应用程序项目添加了对它的引用:

一切似乎都运行正常:应用程序使用默认标记显示地图和叠加层.所以我很确定我已经正确设置了Google Play服务和Google Maps API.

但是,每当初始化地图视图时(在第二代Nexus 7上),我都会在ADT LogCat窗口中看到此消息:

The Google Play services resources were not found. Check your project configuration to ensure that the resources are included.
Run Code Online (Sandbox Code Playgroud)

消息级别为Error,标记为GooglePlayServicesUtil.

这似乎是良性的,因为我的应用程序确实工作正常.但我该怎么做或检查以试图解决可能出现的问题?


更多信息:每次在LogCat中显示"未找到Google Play服务资源"消息时,都会显示以下消息,即警告并标记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)
Run Code Online (Sandbox Code Playgroud)

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' …
Run Code Online (Sandbox Code Playgroud)

android google-maps google-play-services

316
推荐指数
6
解决办法
14万
查看次数

Google MapFragment为空白(白色),找不到类'maps.jk'

我正在尝试在(姜饼2.3.5)手机上构建官方Android谷歌地图api v2样本.我加入android-support-v4.jar了官方样本项目.

我从官方教程中取样 <android-sdk>/extras/google-play-services/samples/maps

我在Eclipse中复制了示例应用程序,将google-play-services_lib项目作为Android库引用,并使用Android SDK 4.1.2(api 16)构建整个项目.

不幸的是,我启动应用程序时地图是空白的,我没有任何异常或消息.我唯一得到的是logcat中可疑的行:

    Unable to resolve superclass of Lmaps/a/du; (411)                     
    Link of class 'Lmaps/a/du;' failed                                    
    Unable to resolve superclass of Lmaps/a/ej; (2363)                    
    Link of class 'Lmaps/a/ej;' failed                                    
    Unable to resolve superclass of Lmaps/j/k; (2379)                     
    Link of class 'Lmaps/j/k;' failed                                     
Run Code Online (Sandbox Code Playgroud)

ERR找不到类'maps.j.k',从方法maps.y.ae.a引用.VFY
:无法解析Lmaps/y/ae中的新实例3571(Lmaps/j/k;);

我怀疑我在eclipse 3.8中的项目结构有些搞砸了.

我试过以下的事情(即使是最愚蠢的)也无济于事.

1.无效的api密钥?

我使用keytool生成了一个"debug.keystore"并更新了eclipse首选项(Android/Build/Keystore).当然,我注册了新的密钥库/ SHA1并获得了我在AndroidManifest文件中使用的新api密钥

2.错误的项目目标?

我尝试使用以下目标构建我的两个项目:

  • Android 4.2.1
  • Google Api 4.2.1

3.添加google-play-services_lib作为项目依赖项

我尝试将google-play-services_lib添加为项目依赖项,并在演示构建路径中添加为android库.勾选匹配的导出复选框.

4.在手机上测试google maps api v2

我下载了trulia房地产应用程序,据说在手机上使用v2 api以确保手机与新api兼容

这是示例应用程序的清单

<?xml version="1.0" encoding="utf-8"?> …
Run Code Online (Sandbox Code Playgroud)

android google-maps

16
推荐指数
2
解决办法
1万
查看次数