“org.apache.http.HttpEntity'是pcated德$ P $。如何解决Android的工作室这个错误? [英] 'org.apache.http.HttpEntity' is deprecated. How to solve this error in android studio?

查看:230
本文介绍了“org.apache.http.HttpEntity'是pcated德$ P $。如何解决Android的工作室这个错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用机器人工作室API22和我有这些错误:

i'm using android studio API22 and i have these errors:

'org.apache.http.HttpEntity' is deprecated
'org.apache.http.HttpResponse' is deprecated
'org.apache.http.NameValuePair' is deprecated
'org.apache.http.client.HttpClient' is deprecated
'org.apache.http.client.entity.UrlEncodedFormEntity' is deprecated
'org.apache.http.client.methods.HttpPost' is deprecated
'org.apache.http.impl.client.DefaultHttpClient' is deprecated
'org.apache.http.message.BasicNameValuePair' is deprecated
'org.apache.http.params.BasicHttpParams' is deprecated
'org.apache.http.params.HttpConnectionParams' is deprecated
'org.apache.http.params.HttpParams' is deprecated
'org.apache.http.util.EntityUtils' is deprecated

我怎样才能解决这个问题?

How can i solve this?

推荐答案

添加到您的摇篮

useLibrary 'org.apache.http.legacy'

示例

android {
compileSdkVersion 23
buildToolsVersion "23.0.1"
defaultConfig {
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 2
    versionName "1.0.1"
}
buildTypes {
    release {
        debuggable false
        signingConfig signingConfigs.releaseConfig
        minifyEnabled true
        shrinkResources true
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
    debugSigned {
        debuggable true
        signingConfig signingConfigs.releaseConfig
    }
    debug {
        debuggable true
    }
}
useLibrary 'org.apache.http.legacy'
}

这篇关于“org.apache.http.HttpEntity'是pcated德$ P $。如何解决Android的工作室这个错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆