依赖org.apache.httpcomponents:httpclient:4.4.1的发布会被忽略,因为它可能与Android提供的内部版本冲突 [英] Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored for release as it may be conflicting with the internal version provided by Android

查看:174
本文介绍了依赖org.apache.httpcomponents:httpclient:4.4.1的发布会被忽略,因为它可能与Android提供的内部版本冲突的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在项目中使用httpmime和httpcore,并且收到此警告

I am using httpmime and httpcore in my project and I am getting this warning

警告:依赖项org.apache.httpcomponents:httpclient:4.4.1是 为调试而忽略,因为它可能与内部版本冲突 由Android提供.

Warning:Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored for debug as it may be conflicting with the internal version provided by Android.

警告:依赖项org.apache.httpcomponents:httpclient:4.4.1是 为调试而忽略,因为它可能与内部版本冲突 由Android提供.

Warning:Dependency org.apache.httpcomponents:httpclient:4.4.1 is ignored for debug as it may be conflicting with the internal version provided by Android.

我的依赖关系如下

dependencies {    
    compile files('libs/gson-2.2.2.jar')
    compile files('libs/classes.jar')
    compile files('libs/gcm.jar')
    compile files('libs/splunk-mint-4.2.jar')
    compile 'com.android.support:appcompat-v7:22.2.0'
    compile 'org.apache.httpcomponents:httpcore:4.4.1'
    compile 'org.apache.httpcomponents:httpmime:4.4.1'}

如在其他地方所建议的,我将此添加到了build.gradle文件中

As suggested in other places I added this to my build.gradle file

packagingOptions {
exclude 'META-INF/DEPENDENCIES.txt'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/notice.txt'
exclude 'META-INF/license.txt'
exclude 'META-INF/dependencies.txt'
exclude 'META-INF/LGPL2.1'}

有什么办法解决这个问题吗?

Any idea how to solve this issue?

推荐答案

使用适用于android的apache http客户端的重新打包版本

Use repacked version of the apache http client suitable for android

dependencies {
    compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
}

https://hc.apache.org/httpcomponents- client-4.3.x/android-port.html

这篇关于依赖org.apache.httpcomponents:httpclient:4.4.1的发布会被忽略,因为它可能与Android提供的内部版本冲突的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆