由Android提供的JSON版本的Apache HTTP客户端错误 [英] Apache http client error with json version provided by android

查看:128
本文介绍了由Android提供的JSON版本的Apache HTTP客户端错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从url(从Android API级别23中删除的Apache http客户端)解析json.如果我在android studio中使用httpclient.jar文件,则会显示类似以下错误:

I am trying to parse json from url, Apache http client removed from Android API level 23. If I use httpclient.jar files in android studio, it shows error like:

"Warning:Dependency org.json:json:20090211被调试时忽略,因为它 可能与Android提供的内部版本冲突."

"Warning:Dependency org.json:json:20090211 is ignored for debug as it may be conflicting with the internal version provided by Android."

dependencies{

    compile files('libs/httpclient-4.5.1.jar')
    compile files('libs/httpcore-4.5.1.jar')
}

如何解决此错误.

谢谢.

推荐答案

如果您只想在sdk23中使用apache客户端.您是否尝试使用在gradle中添加此代码.

if you just want to use apache client in sdk23. doDo you try to useadd this code in gradle.

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

请参见 HttpClient无法导入Android Studio

这篇关于由Android提供的JSON版本的Apache HTTP客户端错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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