通过下载库,将其添加到工作区,然后将其作为库引用,我让 Google Maps Android API v2 在我的 Android 应用程序上完美运行。
但是一旦包含 map fragment 的 Activity 开始,我仍然会收到此错误
Could not find class 'maps.i.k', referenced from method maps.z.ag.a
顺便说一句,我正在使用支持 map fragment
这个错误似乎并没有影响到我,也没有使应用程序崩溃,我应该修复它吗?
添加 list P.S E_SelectJourney 是我显示和使用 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>
添加了 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
最佳答案
删除此代码:
<uses-library
android:name="com.google.android.maps"
android:required="true" />
首先,Google Map API V2 不需要它。
接下来,尝试将此代码移动到结束 application 标记之前:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
像那样:
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyBoWsWNaUTWyHxGuJuNehzfbNvyTv1zIeA" />
</application>
最后检查您是否在 Google API 控制台中打开了正确的 API 服务:
您可以从我写的这两篇博客文章中获得关于这两个主题的更多信息:
和:
更新:
有关许可,请检查此链接:
http://android-er.blogspot.co.il/2012/12/include-open-source-software-license.html
基本上在您的应用程序的某个地方,无论是 Activity 还是对话框,您都必须运行:
String LicenseInfo = GooglePlayServicesUtil.getOpenSourceSoftwareLicenseInfo(getApplicationContext());
并以某种形式展示结果。
关于android - 谷歌地图在 Android 上运行良好,但我仍然收到错误 "Could not find class ' maps.i.k',引用自方法 maps.z.ag.a",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15145789/
我正在学习如何使用Nokogiri,根据这段代码我遇到了一些问题:require'rubygems'require'mechanize'post_agent=WWW::Mechanize.newpost_page=post_agent.get('http://www.vbulletin.org/forum/showthread.php?t=230708')puts"\nabsolutepathwithtbodygivesnil"putspost_page.parser.xpath('/html/body/div/div/div/div/div/table/tbody/tr/td/div
总的来说,我对ruby还比较陌生,我正在为我正在创建的对象编写一些rspec测试用例。许多测试用例都非常基础,我只是想确保正确填充和返回值。我想知道是否有办法使用循环结构来执行此操作。不必为我要测试的每个方法都设置一个assertEquals。例如:describeitem,"TestingtheItem"doit"willhaveanullvaluetostart"doitem=Item.new#HereIcoulddotheitem.name.shouldbe_nil#thenIcoulddoitem.category.shouldbe_nilendend但我想要一些方法来使用
类classAprivatedeffooputs:fooendpublicdefbarputs:barendprivatedefzimputs:zimendprotecteddefdibputs:dibendendA的实例a=A.new测试a.foorescueputs:faila.barrescueputs:faila.zimrescueputs:faila.dibrescueputs:faila.gazrescueputs:fail测试输出failbarfailfailfail.发送测试[:foo,:bar,:zim,:dib,:gaz].each{|m|a.send(m)resc
我正在尝试设置一个puppet节点,但rubygems似乎不正常。如果我通过它自己的二进制文件(/usr/lib/ruby/gems/1.8/gems/facter-1.5.8/bin/facter)在cli上运行facter,它工作正常,但如果我通过由rubygems(/usr/bin/facter)安装的二进制文件,它抛出:/usr/lib/ruby/1.8/facter/uptime.rb:11:undefinedmethod`get_uptime'forFacter::Util::Uptime:Module(NoMethodError)from/usr/lib/ruby
我正在尝试测试是否存在表单。我是Rails新手。我的new.html.erb_spec.rb文件的内容是:require'spec_helper'describe"messages/new.html.erb"doit"shouldrendertheform"dorender'/messages/new.html.erb'reponse.shouldhave_form_putting_to(@message)with_submit_buttonendendView本身,new.html.erb,有代码:当我运行rspec时,它失败了:1)messages/new.html.erbshou
我在从html页面生成PDF时遇到问题。我正在使用PDFkit。在安装它的过程中,我注意到我需要wkhtmltopdf。所以我也安装了它。我做了PDFkit的文档所说的一切......现在我在尝试加载PDF时遇到了这个错误。这里是错误:commandfailed:"/usr/local/bin/wkhtmltopdf""--margin-right""0.75in""--page-size""Letter""--margin-top""0.75in""--margin-bottom""0.75in""--encoding""UTF-8""--margin-left""0.75in""-
我在我的项目目录中完成了compasscreate.和compassinitrails。几个问题:我已将我的.sass文件放在public/stylesheets中。这是放置它们的正确位置吗?当我运行compasswatch时,它不会自动编译这些.sass文件。我必须手动指定文件:compasswatchpublic/stylesheets/myfile.sass等。如何让它自动运行?文件ie.css、print.css和screen.css已放在stylesheets/compiled。如何在编译后不让它们重新出现的情况下删除它们?我自己编译的.sass文件编译成compiled/t
大约一年前,我决定确保每个包含非唯一文本的Flash通知都将从模块中的方法中获取文本。我这样做的最初原因是为了避免一遍又一遍地输入相同的字符串。如果我想更改措辞,我可以在一个地方轻松完成,而且一遍又一遍地重复同一件事而出现拼写错误的可能性也会降低。我最终得到的是这样的:moduleMessagesdefformat_error_messages(errors)errors.map{|attribute,message|"Error:#{attribute.to_s.titleize}#{message}."}enddeferror_message_could_not_find(obje
我想了解Ruby方法methods()是如何工作的。我尝试使用“ruby方法”在Google上搜索,但这不是我需要的。我也看过ruby-doc.org,但我没有找到这种方法。你能详细解释一下它是如何工作的或者给我一个链接吗?更新我用methods()方法做了实验,得到了这样的结果:'labrat'代码classFirstdeffirst_instance_mymethodenddefself.first_class_mymethodendendclassSecond使用类#returnsavailablemethodslistforclassandancestorsputsSeco
在选择我想要运行操作的频率时,唯一的选项是“每天”、“每小时”和“每10分钟”。谢谢!我想为我的Rails3.1应用程序运行调度程序。 最佳答案 这不是一个优雅的解决方案,但您可以安排它每天运行,并在实际开始工作之前检查日期是否为当月的第一天。 关于ruby-如何每月在Heroku运行一次Scheduler插件?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/questions/8692687/