android开发问题-关于Xutils框架出现无法访问HttpRequestBase 找不到org.apache.http.client.methods.HttpRequestBase解决方案

来源:互联网 发布:淘宝客qq群哪里有引流 编辑:程序博客网 时间:2024/05/16 08:53

Error:(62, 30) 错误: 无法访问HttpRequestBase

找不到org.apache.http.client.methods.HttpRequestBase的类文件
注: 某些输入文件使用或覆盖了已过时的 API。
注: 有关详细信息, 请使用 -Xlint:deprecation 重新编译。
android 6.0(api 23) SDK,Android的网络请求强制使用HttpUrlConnection,并且SDK中也已经移除了HttpClient。
解决方法:

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 {}中

1 0
原创粉丝点击