【问题标题】:While rebuilding my project warning about httpcomponents is shown在重建我的项目时显示有关 httpcomponents 的警告
【发布时间】:2017-03-20 15:58:23
【问题描述】:

在重建我的项目时,我遇到了这个警告

Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.0.1 is ignored for debug as it may be conflicting with the internal version provided by Android.

这是我的 gradle.build,我尝试在给定链接中添加所述解决方案,但问题仍然存在。那我该怎么办?

android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
// tried this but no help
// useLibrary 'org.apache.http.legacy'
defaultConfig {
    minSdkVersion 18
    targetSdkVersion 25
    versionCode 1
    versionName "1.0.0"
    resConfigs "en_US", "hi_IN"
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
packagingOptions {
    exclude 'META-INF/LICENSE'
    exclude 'META-INF/DEPENDENCIES'
    exclude 'META-INF/NOTICE'
}
configurations.all {
    resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'
}

 }
   dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    exclude group: 'com.android.support', module: 'support-annotations'
})
//tried this but no help
  // compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5.1'
compile 'com.android.support:appcompat-v7:25.1.1'
compile 'com.android.support:support-v4:25.1.1'
compile 'com.android.support:design:25.1.1'
compile 'com.android.support:gridlayout-v7:25.1.1'
compile 'com.android.support:cardview-v7:25.1.1'
testCompile 'junit:junit:4.12'

Question reffered for solution

【问题讨论】:

  • 这个build.gradle 是完整的还是编辑的? libs dir 中是否有任何依赖关系?

标签: android dependencies android-gradle-plugin


【解决方案1】:

编辑:问题是关于其他的

像这样添加依赖:

android {
    useLibrary 'org.apache.http.legacy'
}

从这里:https://developer.android.com/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client

【讨论】:

  • 我已经尝试过了,但没有成功,警告仍然出现。
【解决方案2】:

从我的项目中完全删除此依赖项后问题解决

compile 'io.kickflip:sdk:1.3.1'

也来自我的库目录。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 2011-07-18
    • 2017-10-11
    • 2017-05-21
    • 2014-05-02
    • 2014-11-04
    • 2020-02-22
    相关资源
    最近更新 更多