갓토리

안드로이드] HttpClient Gradle 오류해결 본문

IT/프로그래밍

안드로이드] HttpClient Gradle 오류해결

ZungTa 2015. 9. 16. 11:33

안드로이드에서 HttpClient Gradle 을 추가해서 쓸려고하니까

compile (group: 'org.apache.httpcomponents' , name: 'httpmime' , version: '4.3.5') { exclude module: 'org.apache.httpcomponents:httpclient'}

2 warnings 가 떴다.

내용은

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

         In case of problem, please repackage it with jarjar to change the class packages

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

         In case of problem, please repackage it with jarjar to change the class packages


무시하고 하려고하니까 HttpClient 사용이 안되었다.


그래서 이것저것 해보니까

compileSdkVersion, buildToolsVersion, targetSdkVersion

그리고 dependencies 의 컴파일 appcompat 버전을 바꿔줘야 했다.

apply plugin: 'com.android.application'

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"

defaultConfig {
applicationId "com.example.wook.w0916_a"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.0.1'
compile (group: 'org.apache.httpcomponents' , name: 'httpmime' , version: '4.3.5') { exclude module: 'org.apache.httpcomponents:httpclient'}
}



이거를

apply plugin: 'com.android.application'

android {
compileSdkVersion 22
buildToolsVersion "22.0.1"

defaultConfig {
applicationId "com.example.wook.w0916_a"
minSdkVersion 15
targetSdkVersion 22
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:22.1.1'
compile (group: 'org.apache.httpcomponents' , name: 'httpmime' , version: '4.3.5') { exclude module: 'org.apache.httpcomponents:httpclient'}
}

로 바꿔주었다.

Comments