Android 6.0(api 23)SDK已經強制移除httpclient
解決方案:
1降低api
2build.gradle中添加一句話
android {
useLibrary'org.apache.http.legacy'
}
比如我這樣:
android {
compileSdkVersion 23
buildToolsVersion "24.0.0"
defaultConfig {
applicationId "com.example.myapplication"
useLibrary'org.apache.http.legacy'
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
更多詳細資源請參考github地址: