前言
转自Google官博
*Android 6.0 release removes support for the Apache HTTP client. If your app is using this client and targets Android 2.3 (API level 9) or higher, use the HttpURLConnection class instead. *
Google为了强推HttpURLConnection,直接在Android 6.0 SDK中移除了Apache HttpClient库支持,不过并没有把这条路堵死,并给出了解决办法,看来Google也不敢乱来啊_
解决办法
eclipse ADT
libs中加入.\sdk\platforms\android-23\optional\org.apache.http.legacy.jar
Android Studio
在对应的Module下的build.gradle中加入:
android {
useLibrary 'org.apache.http.legacy'
}
虽然Google给出了解决办法,但还是推荐大家使用轻量级的HttpURLConnection,毕竟官方支持。
Android6.0发布时移除了对ApacheHttpClient的支持,对于依赖此库的应用,Google建议使用HttpURLConnection作为替代方案。若仍需使用ApacheHttpClient,则可通过特定方式引入遗留库。
3572

被折叠的 条评论
为什么被折叠?



