我在我的项目中使用了 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'}
知道如何解决这个问题吗?
最佳答案
先去掉线条
编译'org.apache.httpcomponents:httpcore:4.4.1'
编译 'org.apache.httpcomponents:httpmime:4.4.1'
然后在他们的位置添加行 in build.gradle given by:
compile ('org.apache.httpcomponents:httpmime:4.3'){
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'commons-io:commons-io:1.3.2'
如果您的 compileSdkVersion 是 19(在我的情况下),您可以试试这个。希望这能解决问题...
关于android - 依赖 org.apache.httpcomponents :httpclient:4. 4.1 被忽略发布因为它可能与 Android 提供的内部版本冲突,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30755989/