xutils Error:(37, 39) 錯誤: 無法訪問HttpRequestBase 找不到org.apache.http.client.methods.HttpRequestBase的類文件


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地址:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM