Apache HTTP connection with Android 6.0 (Marshmallow)

我们两清 提交于 2019-11-26 20:46:06

This page discusses the removal of the Apache HTTP classes, and it suggests a workaround as well:

To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

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

In my case Android Studio still complained that it couldn't find these classes, but the app did build and run.

The page does recommend you move to HttpURLConnection, though.

According to the API 22-23 diff changes, the org.apache.http.* packages have been removed as of Android 6.0 (Marshmallow) API Level 23.

http://developer.android.com/sdk/api_diff/23/changes.html

via : http://android-developers.blogspot.co.uk/2015/08/m-developer-preview-3-final-sdk.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!