1. 程式人生 > >The type org.apache.http.HttpEntity cannot be resolved.錯誤的解決

The type org.apache.http.HttpEntity cannot be resolved.錯誤的解決

詳見http://stackoverflow.com/questions/32434488/the-type-org-apache-http-header-cannot-be-resolved-it-is-indirectly-referenced

錯誤內容:The type org.apache.http.HttpEntity cannot be resolved. It is indirectly referenced from required .class files。。。。。

解決方法: 如上連線所述 

如果是studio的話,在gradle中增加  useLibrary ‘org.apache.http.legacy’

                如果是eclipse的話,在AndroidSDK/platforms/android-23/optional 找到對應的包 匯入


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

In Android Studio add

 android {
    useLibrary 'org.apache.http.legacy'
}

to build.gradle.

In Eclipse copy org.apache.http.legacy.jar

 from AndroidSDK/platforms/android-23/optionalto libs folder.