引用此线程Using webdav on Android
可以将Sardine lib(http://code.google.com/p/sardine/)与httpclientandroidlib(http://code.google.com/p/httpclientandroidlib/)结合使用。

但是我一直收到java.lang.VerifyError异常。

我试图将Sardine lib作为jar文件和Eclipse-project引用,但始终相同。

如果我从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和Java 1.6。

最佳答案

不知道发生了什么,但是您尝试了https://github.com/yeonsh/Sardine-Android吗?

10-08 06:01