【问题标题】:Can't resolve httpclient in sardine on android 4.1无法在 android 4.1 上解析沙丁鱼中的 httpclient
【发布时间】:2013-11-15 06:12:34
【问题描述】:

我正在使用最新的 Sardine https://github.com/lookfirst/sardine WebDav 客户端,它使用 httpclient 4.2.4 我正在尝试在使用 httpclient 4.0.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>

但是在 Sardine init 方法运行时我得到了

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

意味着它很可能会尝试使用旧版本的 httpclient。如何使用 4.2.4 httpclient 版本强制它?

【问题讨论】:

    标签: java android webdav sardine


    【解决方案1】:

    排除平台提供的库可能没有多大意义,如果它在那里的话

    有一个关于这个问题的评论 - Latest Apache HttpClient in Android SDK - 但我认为你不会。

    所以我认为你被卡住了,除非你想重构沙丁鱼以使用上面帖子中提到的 httpclient 的替代包装。

    【讨论】:

      猜你喜欢
      • 2017-10-31
      • 1970-01-01
      • 1970-01-01
      • 2011-12-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多