Apache的HttpClient的机器人(摇篮) [英] Apache HttpClient Android (Gradle)

查看:287
本文介绍了Apache的HttpClient的机器人(摇篮)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我加入这行到我的build.gradle

I have added this line to my build.gradle

compile group: 'org.apache.httpcomponents' , name: 'httpclient-android' , version: '4.3.5'

和我想在我的code使用MultipartEntityBuilder。然而Android的工作室并不库添加到我的code。
谁能帮我这个?

and I want to use MultipartEntityBuilder in my code. However Android studio doesn't add the library to my code. Can anyone help me with this?

推荐答案

如果您正在使用目标的SDK作为23在你的build.gradle下面添加code

if you are using target sdk as 23 add below code in your build.gradle

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

附加说明在这里:不要尝试使用这些文件的版本的Gradle。都碎(15年8月28日)。我试过5小时,得到它的工作。它只是不。
不工作:

additional note here: dont try using the gradle versions of those files. they are broken (28.08.15). I tried over 5 hours to get it to work. it just doesnt. not working:

compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'org.apache.httpcomponents:httpclient:4.5'

另一件事 不要使用:

'org.apache.httpcomponents:httpclient-android:4.3.5.1'

其指21 API级别。

这篇关于Apache的HttpClient的机器人(摇篮)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆