我在我的项目中使用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客户端的重新打包版本
原文链接:https://www.f2er.com/javaschema/282039.htmldependencies { 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