Android Studio无法使用Apache的HttpClient
来源:互联网 发布:个人理财产品 知乎 编辑:程序博客网 时间:2024/05/22 04:00
你可能需要把以前的项目从Eclipse移到Android Studio, 如果你使用了HttpClient以及和他相关的开源框架, 恭喜你, 可能会报一下错,
这么大的事, 官方也给了解决方案:
官方文档: Android 6.0 Changes
http://developer.android.com/intl/zh-cn/about/versions/marshmallow/android-6.0-changes.html#behavior-apache-http-client
Apache HTTP Client Removal
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. This API is more efficient because it reduces network use through transparent compression and response caching, and minimizes power consumption. 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'}
大概就是删除了HttpClient, 用HttpURLConnection替代, 巴拉巴拉…. 如果还要继续使用Apache HTTP API, 需要在Module的build.gradle里面配置这句:
android { useLibrary 'org.apache.http.legacy'}
在然后就能用HttpClient了
- Android Studio无法使用Apache的HttpClient
- 关于Android Studio中无法使用Apache的HttpClient的问题
- Android | Android Studio无法使用HttpClient的解决办法
- HttpClient在Android Studio中无法使用的问题。
- Android studio无法使用HttpClient解决
- android studio 使用httpclient
- Android的网络应用-使用Apache HttpClient
- 【Android基础知识】Apache HttpClient的基本使用
- apache HttpClient的使用
- android studio apache HttpClient upload NoSuchFieldError
- Android Studio 找不到Apache HttpClient相关类
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- Android 6.0 使用 Apache HttpClient
- 调整Android手机的默认亮度
- oninput,onpropertychange,onchange的用法和区别
- C#设计模式—桥接模式
- 《ViewPager 详解(二)---详解四大函数》
- 十五.增加一个项目协作留言板功能(一)----- 建立留言板的model
- Android Studio无法使用Apache的HttpClient
- gearman:从安装到python API测试
- 第二课作业(刘萌150206318)
- camshiftdemo.cpp的详细注释
- 常用正则表达式
- CSS中强大的em
- PX4二次开发
- 安卓自带下拉刷新SwipeRefreshLayout添加上拉刷新功能
- 只有五行的Floyd最短路算法