引用此帖子Using webdav on Android 可以将沙丁鱼库(http://code.google.com/p/sardine/)与httpclientandroidlib(http://code.google.com/p/httpclientandroidlib/)结合使用。
但我不断收到java.lang.VerifyError异常。
我尝试将Sardine lib引用为jar文件和Eclipse项目,但它始终是相同的。
如果我从dalvikVM读取消息,则在抛出异常之前,javax.xml.bind.JAXBContext.newInstance()存在问题。但是我无法将JAXB库或源添加到项目中,因为我得到了几个Dx错误:
[2011-10-28 16:48:40 - FireTablet] Dx 1 error; aborting
[2011-10-28 16:48:40 - FireTablet] Conversion to Dalvik format failed with error 1
[2011-10-28 16:49:00 - FireTablet] Dx
trouble processing "javax/xml/bind/PrintConversionEvent.class":
所以这不能成为解决方案。有谁知道如何在android上运行沙丁鱼库?
我非常感谢您的帮助!
例外:
10-28 16:21:33.602: I/Process(22992): Sending signal. PID: 22992 SIG: 9
10-28 16:30:59.005: I/dalvikvm(23056): Could not find method javax.xml.bind.JAXBContext.newInstance, referenced from method com.googlecode.sardine.util.SardineUtil.<clinit>
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to resolve static method 20578: Ljavax/xml/bind/JAXBContext;.newInstance ([Ljava/lang/Class;)Ljavax/xml/bind/JAXBContext;
10-28 16:30:59.005: D/dalvikvm(23056): VFY: replacing opcode 0x71 at 0x000a
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to resolve exception class 2678 (Ljavax/xml/bind/JAXBException;)
10-28 16:30:59.005: W/dalvikvm(23056): VFY: unable to find exception handler at addr 0x50
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejected Lcom/googlecode/sardine/util/SardineUtil;.<clinit> ()V
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejecting opcode 0x0d at 0x0050
10-28 16:30:59.005: W/dalvikvm(23056): VFY: rejected Lcom/googlecode/sardine/util/SardineUtil;.<clinit> ()V
10-28 16:30:59.005: W/dalvikvm(23056): Verifier rejected class Lcom/googlecode/sardine/util/SardineUtil;
10-28 16:30:59.005: D/AndroidRuntime(23056): Shutting down VM
10-28 16:30:59.005: W/dalvikvm(23056): threadid=1: thread exiting with uncaught exception (group=0x40015578)
10-28 16:30:59.009: E/AndroidRuntime(23056): FATAL EXCEPTION: main
10-28 16:30:59.009: E/AndroidRuntime(23056): java.lang.VerifyError: com.googlecode.sardine.util.SardineUtil
10-28 16:30:59.009: E/AndroidRuntime(23056): at com.googlecode.sardine.impl.SardineImpl.list(SardineImpl.java:339)
10-28 16:30:59.009: E/AndroidRuntime(23056): at hsr.ifs.firetablet.network.WebDavConnector.getFacilityNames(WebDavConnector.java:36)
我使用Android API级别10&amp; Java 1.6。
答案 0 :(得分:0)
不确定发生了什么,但您是否尝试https://github.com/yeonsh/Sardine-Android?
答案 1 :(得分:0)
我也有同样的问题并修改了Sardine项目以使用SimpleXml而不是JAXB。这是我的库版本:https://github.com/thegrizzlylabs/sardine-android