2013-11-15 31 views
0

我使用的是採用最新的沙丁魚https://github.com/lookfirst/sardine WebDAV客戶端的HttpClient 4.2.4 我想說明的是,它使用的HttpClient 4.0.1無法解析的HttpClient沙丁魚於Android 4.1

上4.1.1.4工作

有了它排除建立完美

<dependency> 
     <groupId>com.google.android</groupId> 
     <artifactId>android</artifactId> 
     <version>${platform.version}</version> 
     <scope>provided</scope> 
     <exclusions> 
      <exclusion> 
       <artifactId>httpclient</artifactId> 
       <groupId>org.apache.httpcomponents</groupId> 
      </exclusion> 
     </exclusions> 
    </dependency> 
    <dependency> 
     <groupId>com.actionbarsherlock</groupId> 
     <artifactId>actionbarsherlock</artifactId> 
     <version>4.4.0</version> 
     <type>apklib</type> 
    </dependency> 
    <dependency> 
     <groupId>com.j256.ormlite</groupId> 
     <artifactId>ormlite-core</artifactId> 
     <version>4.47</version> 
    </dependency> 
    <dependency> 
     <groupId>com.j256.ormlite</groupId> 
     <artifactId>ormlite-android</artifactId> 
     <version>4.47</version> 
    </dependency> 
    <dependency> 
     <groupId>com.github.lookfirst</groupId> 
     <artifactId>sardine</artifactId> 
     <version>5.0.1</version> 
    </dependency> 

但在沙丁魚init方法運行過程中出現了

 AndroidRuntime﹕ FATAL EXCEPTION: main 
    java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init> 

含義最喜歡它試圖使用舊版本的httpclient。我如何使用4.2.4 httpclient版本強制使用它?

回答

1

大概犯規多大意義,排除平臺提供的庫,如果它的存在,它的存在

有一個關於這個問題的評論 - Latest Apache HttpClient in Android SDK - 但我不認爲這會你。

所以我認爲你被卡住了,除非你想重構沙丁魚使用上面提到的httpclient替代包裝。