首页 技术 正文
技术 2022年11月16日
0 收藏 765 点赞 2,944 浏览 1207 个字

参考:http://stackoverflow.com/questions/32153318/httpclient-wont-import-in-android-studiohttp://www.zhihu.com/question/35597452/answer/63619567http://stackoverflow.com/questions/33898857/why-warningunable-to-find-optional-library-org-apache-http-legacy-occurs  1. 在Android模块里面添加android {
    useLibrary ‘org.apache.http.legacy’
} 这个对我不起作用,依然提示 不识别 org.apache.http.legacy  更新:发现在 SDK/platforms/android-23/optional 下面其实是有org.apache.http.legacy这个文件的。在这个目录下新建 optional.json, 内容如下:==========[ { “name”: “org.apache.http.legacy”, “jar”: “org.apache.http.legacy.jar”, “manifest”: false } ]===========然后这个方法生效。(谁动了我的optional.json ?!) 2. 在Dependency中添加:dependencies {
    compile ‘org.apache.httpcomponents:httpcore:4.4.2’
} 这个亲测有效!! ^_^ 3. 在Dependency中添加:compile ‘org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2’ 没有测试,估计有效。看别人的回复: 

You can simply add this to Gradle dependencies:

compile "org.apache.httpcomponents:httpcore:4.3.2"

========================This helps. But still not enough if you want to use other classes like HttpGet. For that I used compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.cli‌​ent:4.1.2' – AlexAndro Oct 5 ’15 at 9:10  在Dependency中添加以后, Gradle会自动从server下载所需要的依赖。好神奇。。。似乎是下载到了SDK的目录?

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,077
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,552
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,400
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,176
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,813
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,896