当前位置: 首页 > 知识库问答 >
问题:

不推荐使用'org.apache.http.HttpEntity'。如何解决android Studio中的这个错误?

通奕
2023-03-14

我正在使用android studio API22,我有以下错误:

'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

共有1个答案

穆丁雨
2023-03-14

把这个加到你的年级

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'
}
 类似资料:
  • 我创建了Tic Tac Toe Android应用程序。当我单击play again重新启动一个新游戏时,我面临崩溃。

  • 配置根项目“我的应用程序”时出现问题。 未能解析配置“:classpath”的所有工件。无法解析com.android.tools.build:gradle:3.6.2。project:脱机模式下没有com.android.tools.build:gradle:3.6.2的缓存版本。脱机模式下没有com.android.tools.build:gradle:3.6.2的缓存版本。 这是我的错误,我

  • 运行上述操作后,我得到了错误: ValueError:数据帧的真值不明确。使用a.empty、a.bool()、a.item()、a.any()或a.all()。 请告知我如何解决此问题。

  • 问题内容: 我有以下使用函数在PHP 5.3之前运行良好的语句: 升级到PHP 5.3后,我收到了不赞成使用的警告: 不推荐使用:不推荐使用split()函数。 我正在尝试解析具有以下格式的字符串: 2010-08-10 23:07:58 成为其组成部分。 问题答案: 我认为您想要preg_split。

  • 这是我的密码。数据库名为socapa。 当我运行项目时,出现下面的错误。 Illumb\Database\QueryException SQLSTATE[42000]:语法错误或访问冲突:1055'socapa。联络。“FirstName”不在组中(SQL:选择,,联系人ID,,课程ID,注册,城市,<代码>状态,<代码>国家,<代码>CampusName,<代码>程序名,<代码>会话ID,<代码

  • 我是Springboot的新手,我通过Sping的教程和“https://spring.io/guides”指南来学习。 现在我试图理解并重做教程:“使用MySQL访问数据” 不幸的是,我在Mavenbuild期间出错: 启动ApplicationContext时出错。要显示自动配置报告,请在启用“调试”的情况下重新运行应用程序。2017-12-07 10:26:42.708错误8100---[m