我在我的項目中多個模塊,並添加以下依賴於我的項目級別build.gradle
文件使用整個項目HTTP客戶端庫:無法找到HTTP客戶端庫 - Android電子
compile "cz.msebera.android:httpclient:4.4.1.2"
我創建了一個新的模塊,我想使用上面提到的庫。因此,這裏是我在build.gradle
做該模塊:
android {
compileSdkVersion 25
buildToolsVersion "26.0.0"
useLibrary 'cz.msebera.android.httpclient'
defaultConfig {
minSdkVersion 16
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
我一直在關注this post。試圖同步項目時,我得到以下錯誤:
Error: Unable to find optional library: cz.msebera.android.httpclient
我不明白這裏出了什麼問題。請幫我整理一下。
重複的https://stackoverflow.com/questions/32676049/the-import-org-apache-http-client-cannot-be-resolved-error-when-i-update-sdk-to/35211175#35211175 –
可能重複[導入org.apache.http.client無法解析錯誤,當我更新sdk到M](https://stackoverflow.com/questions/32676049/the-import-org-apache-http-client-解決錯誤時,我更新SDK - ) –