赞
踩
Android Studio在build时提示
Unable to find optional library: org.apache.http.legacy
是说找不到这个类。这是什么情况呢?
查阅文档发现,原来是Android 6.0不再支持 Apache HTTP client, 建议使用 HttpURLConnection 代替。如果还想要继续使用 Apache HTTP client 的,请在build.gradle中添加下面的代码
android {
useLibrary 'org.apache.http.legacy'
}
" Unable to find optional library: org.apache.http.legacy"
解决办法:
1、看看目录 \android-27\optional 下有没有org.apache.http.legacy.jar 和 optional.json
2、如果没有optional.json,则自己新建一个这样的文件,然后加入如下内容:
3 查看对应的目录下面有没有下图这个jar包
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。