美文网首页
SDK 无法使用httpClient

SDK 无法使用httpClient

作者: Kevin223 | 来源:发表于2018-06-08 17:10 被阅读14次

在eclipse或 android studio开发,使用了httpClient相关类的库项目,会出现有一些类找不到的错误。

主要是因为 android 6.0(api 23) SDK,不再提供org.apache.http.*(只保留几个类).

解决方法

1.eclipse:

libs中加入

org.apache.http.legacy.jar

上面的jar包在:**\android-sdk-windows\platforms\android-23\optional下(需要下载android 6.0的SDK)

2.android studio:

在相应的module下的build.gradle中加入:

android {

useLibrary 'org.apache.http.legacy'

}

注意放置的位置:是在android {}中

更具体的解释说明请点击:点击打开链接

相关文章

网友评论

      本文标题:SDK 无法使用httpClient

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