首页 > android api23 抛弃了httpClient,许多基于httpClient第三方库怎么办?

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

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

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


// Apache Http
android {
    useLibrary 'org.apache.http.legacy'
}
// Header
dependencies {
    compile "org.apache.httpcomponents:httpcore:4.3.2"
}

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


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'

}

【热门文章】
【热门文章】