警告:依赖org.apache.httpcomponents:httpclient:4.0.1因调试而被忽略,因为它可能与Android提供的内部版本冲突。
**Build.gradle**:-
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
lintOptions {
// set to true to turn off analysis progress reporting by lint
quiet true
// if true, stop the gradle build if errors are found
abortOnError false
// if true, only report errors
ignoreWarnings true
}
defaultConfig {
applicationId "com.org.mobility"
minSdkVersion 15
targetSdkVersion 24
versionCode 4
versionName "1.6.1"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
repositories {
maven { url 'https://oss.sonatype.org/content/repositories/ksoap2-android-releases/' }
mavenCentral()
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.0.0'
compile 'com.android.support:design:24.0.0'
compile 'com.android.support:support-v4:24.0.0'
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1'
}
感谢任何帮助。 提前谢谢。
答案 0 :(得分:0)
请确保您已在应用程序gradle文件中导入此内容
android {
..
useLibrary 'org.apache.http.legacy'
..
}
答案 1 :(得分:0)
以下是解决方案,您必须编辑以下代码
android {
.....
useLibrary 'org.apache.http.legacy'
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
}
}
在android标签内添加以上代码。希望这会对你有所帮助。
答案 2 :(得分:0)
在您的gradle中添加此项以排除冲突
compile 'com.google.code.ksoap2-android:ksoap2-android:3.6.1' {
exclude module: 'httpclient'
exclude group: 'org.apache.httpcomponents'
exclude group: 'org.apache.httpcomponents', module: 'httpclient'
}
答案 3 :(得分:0)