依赖org.apache.httpcomponents:httpclient:4.4.1因发布而被忽略,因为它可能与Android提供的内部版本冲突

我在我的项目中使用httpmime和httpcore,我收到了这个警告

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.

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文件

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'}

知道如何解决这个问题吗?

使用适用于android的apache http客户端的重新打包版本
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

相关文章

迭代器模式(Iterator)迭代器模式(Iterator)[Cursor]意图...
高性能IO模型浅析服务器端编程经常需要构造高性能的IO模型,...
策略模式(Strategy)策略模式(Strategy)[Policy]意图:定...
访问者模式(Visitor)访问者模式(Visitor)意图:表示一个...
命令模式(Command)命令模式(Command)[Action/Transactio...
生成器模式(Builder)生成器模式(Builder)意图:将一个对...