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

前端之家收集整理的这篇文章主要介绍了依赖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

原文链接:https://www.f2er.com/javaschema/282039.html

猜你在找的设计模式相关文章