1. 程式人生 > >The type org.apache.http.HttpEntityEnclosingRequest cannot be resolved

The type org.apache.http.HttpEntityEnclosingRequest cannot be resolved

Android 6.0 :The type org.apache.http.HttpEntityEnclosingRequest cannot be resolved

解決辦法:

If you are compiling against Android 6.0 (SDK 23), you need to include org.apache.http.legacy library.

如果用 的是Android Studio ,則加上

android { 
useLibrary ‘org.apache.http.legacy’ 
}

如果用的Eclipse:

AndroidSDK/platforms/android-23/optional中的org.apache.http.legacy.jar 複製到專案的libs 資料夾下
 原文來自:http://stackoverflow.com/questions/32434488/the-type-org-apache-http-header-cannot-be-resolved-it-is-indirectly-referenced