我得到了谷歌地图Android的API V2以通过下载库,将其添加到工作区中,则引用它作为一个库完全在我的Android应用程序。
不过,我仍然得到这个错误,只要包含地图碎片的活动开始
找不到类的maps.i.k,从法maps.z.ag.a引用
顺便说一句,我使用支持地图片段
似乎这个错误并不反正影响到我在也没有崩溃的应用程序,也没有什么,我懒得修复它?
补充清单 PS E_SelectJourney是我的显示和使用地图
< XML版本=1.0编码=UTF-8&GT?;
<舱单的xmlns:机器人=http://schemas.android.com/apk/res/android
包=com.HelloMap.AndroidApp
安卓版code =1
机器人:VERSIONNAME =1.0>
<用途-SDK
安卓的minSdkVersion =8
机器人:targetSdkVersion =17/>
<用途特征
机器人:glEsVersion =0x00020000
机器人:要求=真/>
<许可
机器人:名称=com.HelloMap.AndroidApp.permission.MAPS_RECEIVE
安卓的ProtectionLevel =签名/>
<使用-权限的Android:名称=com.HelloMap.AndroidApp.permission.MAPS_RECEIVE/>
<使用-权限的Android:名称=android.permission.INTERNET对/>
<使用-权限的Android:名称=android.permission.WRITE_EXTERNAL_STORAGE/>
<使用-权限的Android:名称=com.google.android.providers.gsf.permission.READ_GSERVICES/>
<使用-权限的Android:名称=android.permission.ACCESS_COARSE_LOCATION/>
<使用-权限的Android:名称=android.permission.ACCESS_FINE_LOCATION/>
<使用-权限的Android:名称=android.permission.ACCESS_NETWORK_STATE/>
<使用-权限的Android:名称=android.permission.GET_ACCOUNTS/>
<应用
机器人:allowBackup =真
机器人:configChanges =方向
机器人:图标=@可绘制/ ic_launcher
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像
机器人:主题=@风格/ Theme.Sherlock>
<使用库
机器人:名称=com.google.android.maps
机器人:要求=真/>
<活动
机器人:名称=com.HelloMap.AndroidApp.A_SplashScreen
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
<意向滤光器>
<作用机器人:名称=android.intent.action.MAIN/>
<类机器人:名称=android.intent.category.LAUNCHER/>
&所述; /意图滤光器>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.B_TourSlides
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.C_RegisterLogin
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动机器人:名称=com.facebook.LoginActivity/>
<活动
机器人:名称=com.HelloMap.AndroidApp.D_RegistrationPage
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.E_SelectJourney
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.F_EnterFromToAddress
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.G_PickDateTime
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.H_ConfirmContact
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.I_MobileVerification
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.J_AvailableTaxis
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.K_SpecialRequirements
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.L_JourneyOverview
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.M_PaymentOptions
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
<活动
机器人:名称=com.HelloMap.AndroidApp.N_Confirmation
机器人:configChanges =方向
机器人:标签=@字符串/ APP_NAME
机器人:screenOrientation =画像>
< /活性GT;
&所述;元数据
机器人:名称=com.google.android.maps.v2.API_KEY
机器人:值=AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA/>
&所述;元数据
机器人:名称=com.facebook.sdk.ApplicationId
机器人:值=141236504136755/>
< /用途>
< /舱单>
添加了logcat的
03-26 16:57:14.897:W / dalvikvm(27771):无法解析的Lmaps / P / S超; (427)
03-26 16:57:14.897:W / dalvikvm(27771):类的链接Lmaps / P / S;'失败
03-26 16:57:14.897:W / dalvikvm(27771):无法解析Lmaps / Y /博超; (3820)
03-26 16:57:14.897:W / dalvikvm(27771):类的链接Lmaps / Y /博;失败
03-26 16:57:14.897:W / dalvikvm(27771):无法解析Lmaps / I / K的父类; (4208)
03-26 16:57:14.897:W / dalvikvm(27771):类的链接Lmaps / I / K;'失败
03-26 16:57:14.897:E / dalvikvm(27771):找不到类的maps.i.k,从法maps.z.ag.a引用
03-26 16:57:14.897:W / dalvikvm(27771):VFY:无法解析新的实例3540(Lmaps / I / K;)在Lmaps / Z /股份公司;
03-26 16:57:15.567:W / SchedPolicy(27771):add_tid_to_cgroup没有写''(参数无效);背景= 0
解决方案
删除此code:
<使用库
机器人:名称=com.google.android.maps
机器人:要求=真/>
首先它不是必需的谷歌地图API V2
的
接下来,尝试将这个code是正确的结束应用程序之前
标签:
<元数据
机器人:名称=com.google.android.maps.v2.API_KEY
机器人:值=AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA/>
这样的:
<元数据
机器人:名称=com.google.android.maps.v2.API_KEY
机器人:值=AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA/>
< /用途>
最后,请检查您是否在谷歌API控制台
打开了右键API服务
:
您可以从这两博客文章我写得到双方的这一主题的更多信息
谷歌地图API V2
和
谷歌地图API V2关键
更新:
有关许可检查此链接:
http://android-er.blogspot.co.il/2012/12/include-open-source-software-license.html
基本上是在应用程序的某个地方活动或一个对话框,是否必须运行这样的:
字符串LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(getApplicationContext());
和present结果以某种形式的时尚。
I got Google Maps Android API v2 to work perfectly on my Android Application by downloading the library, adding it to workspace, then referencing it as a library.
But I still get this error as soon as the activity containing the Map Fragment starts
Could not find class 'maps.i.k', referenced from method maps.z.ag.a
By the way I'm using support map fragment
This error does not seem to affect me in anyway nor crash the application nor anything, should I bother fixing it ?
Added the manifest P.S E_SelectJourney is where I display and use the map
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.HelloMap.AndroidApp"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="8"
android:targetSdkVersion="17" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true" />
<permission
android:name="com.HelloMap.AndroidApp.permission.MAPS_RECEIVE"
android:protectionLevel="signature" />
<uses-permission android:name="com.HelloMap.AndroidApp.permission.MAPS_RECEIVE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<application
android:allowBackup="true"
android:configChanges="orientation"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:screenOrientation="portrait"
android:theme="@style/Theme.Sherlock" >
<uses-library
android:name="com.google.android.maps"
android:required="true" />
<activity
android:name="com.HelloMap.AndroidApp.A_SplashScreen"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.HelloMap.AndroidApp.B_TourSlides"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.C_RegisterLogin"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity android:name="com.facebook.LoginActivity" />
<activity
android:name="com.HelloMap.AndroidApp.D_RegistrationPage"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.E_SelectJourney"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.F_EnterFromToAddress"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.G_PickDateTime"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.H_ConfirmContact"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.I_MobileVerification"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.J_AvailableTaxis"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.K_SpecialRequirements"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.L_JourneyOverview"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.M_PaymentOptions"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<activity
android:name="com.HelloMap.AndroidApp.N_Confirmation"
android:configChanges="orientation"
android:label="@string/app_name"
android:screenOrientation="portrait" >
</activity>
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
<meta-data
android:name="com.facebook.sdk.ApplicationId"
android:value="141236504136755" />
</application>
</manifest>
Added the logcat
03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/p/s; (427)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/p/s;' failed
03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/y/bo; (3820)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/y/bo;' failed
03-26 16:57:14.897: W/dalvikvm(27771): Unable to resolve superclass of Lmaps/i/k; (4208)
03-26 16:57:14.897: W/dalvikvm(27771): Link of class 'Lmaps/i/k;' failed
03-26 16:57:14.897: E/dalvikvm(27771): Could not find class 'maps.i.k', referenced from method maps.z.ag.a
03-26 16:57:14.897: W/dalvikvm(27771): VFY: unable to resolve new-instance 3540 (Lmaps/i/k;) in Lmaps/z/ag;
03-26 16:57:15.567: W/SchedPolicy(27771): add_tid_to_cgroup failed to write '' (Invalid argument); background=0
解决方案
Remove this code:
<uses-library
android:name="com.google.android.maps"
android:required="true" />
first of all it's not required for Google Map API V2
.
Next, try to move this code to be right before the closing application
tag:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
like that:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
</application>
Finally check that you have turned on the right API service
in Google API Console
:
You can get more information on both of this topics from this two blog posts I wrote:
Google Maps API V2
and:
Google Maps API V2 key
UPDATE:
For the licensing check this link:
http://android-er.blogspot.co.il/2012/12/include-open-source-software-license.html
basically in some place in your application whether it an activity or a dialog you have to run this:
String LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(getApplicationContext());
and present the result in some form of fashion.