android6.0以后删除HttpClient的解决方法
16lz
2021-01-26
Android6.0以后, 不再提供org.apache.http.*(只保留几个类),所以导致使用HttpClient的时候会报错,比如
android-async-http等等。
HttpClient在Android2.2以后就不提倡使用了。
这里解决办法就是libs中加入org.apache.http.legacy.jar。
android studio还需要在build.gradle中加入:
android {
useLibrary 'org.apache.http.legacy'
}这样就可以了。 org.apache.http.legacy.jar下载地址点击打开链接
更多相关文章
- android Listview 获取任意指定item数据 getChildAt 挂起 解决办
- 3.addView调用之后导致子布局的android:layout_width="match_par
- Android(安卓)RecyclerView异步更新数据导致的崩溃问题
- Android(安卓)studio 升级Android(安卓)Support Repository(46.0
- android:targetSdkVersion 属性导致程序问题
- Android中Handler导致内存泄漏的原理分析
- android 键盘弹出,布局重绘
- android如何保留小数点后x位数字
- Android(安卓)编译环境配置搭建(Ubuntu 12.04)及环境导致编译错