在重建我的项目警告时显示了httpcomponents

时间:2017-03-20 15:58:23

标签: android dependencies android-gradle

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

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

2 个答案:

答案 0 :(得分:0)

编辑:问题与其他问题有关

像这样添加依赖项:

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

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

答案 1 :(得分:0)

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

compile 'io.kickflip:sdk:1.3.1'

也来自我的libs dir。