美文网首页
使用android_async_http的Head[]错误

使用android_async_http的Head[]错误

作者: 醉月踏秋 | 来源:发表于2017-04-03 19:56 被阅读0次

    在使用第三方框架android_async_http的时候,发现如下错误Head报红,找不到该API

    解决方案:编译一个Apache的包

    在build.gradle文件中:添加android{useLibrary'org.apache.http.legacy'}

    该问题解决方案实质是AndroidStudio导入HttpClient:HttpClient虽然已经被Google抛弃,但是有限项目依然依赖这些库,还得用。

    在API 23中,Google已经移除了移除了Apache HttpClient相关的类 。谷歌推荐使用HttpUrlConnection,如果要继续使用需要Apache HttpClient,需要在

    Eclipse下libs里添加org.apache.http.legacy.jar,

    Android studio里在相应的module下的build.gradle中加入即可。 android {

    useLibrary 'org.apache.http.legacy'

    }

    相关文章

      网友评论

          本文标题:使用android_async_http的Head[]错误

          本文链接:https://www.haomeiwen.com/subject/ppansttx.html