java - android api23 抛弃了httpClient,许多基于httpClient第三方库怎么办?

 刘自龙Sophisten 发布于 2022-11-01 09:45

android sdk升级了api23,原生sdk不提供org.apache.http.*的类(仅仅保留几个)。java上最常用的httpClient也没有了。

一直使用android-async-http、android-ImageLoader等第三方库,都要引用httpClient,这样的话,是要去apache官网下载httpClient.jar来用吗?

3 个回答
  • libs中导入org.apache.http.legacy.jar
    该jar包在:**\sdk\platforms\android-23\optional下

    2022-11-02 02:39 回答
  • // Apache Http
    android {
        useLibrary 'org.apache.http.legacy'
    }
    // Header
    dependencies {
        compile "org.apache.httpcomponents:httpcore:4.3.2"
    }
    2022-11-02 02:40 回答
  • To continue using the Apache HTTP APIs, you must first declare the following compile-time dependency in your build.gradle file:

    android {

    useLibrary 'org.apache.http.legacy'

    }

    2022-11-02 02:41 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有