加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

依赖org.apache.httpcomponents:httpclient:4.4.1因发布而被忽

发布时间:2020-12-14 00:51:23 所属栏目:百科 来源:网络整理
导读:我在我的项目中使用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.
我在我的项目中使用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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读