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

xiaoxiao2021-02-27  150

android6.0之后,已经找不到HttpClient、HttpPost等类了,想要继续使用,需要在androidstudio的build.gradle中配置 useLibrary ‘org.apache.http.legacy’

完整配置如下: ` android { compileSdkVersion 25 buildToolsVersion "25.0.2" defaultConfig { applicationId "com.tony.volley" minSdkVersion 15 targetSdkVersion 25 versionCode 1 versionName "1.0" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } useLibrary 'org.apache.http.legacy' }

转载请注明原文地址: https://www.6miu.com/read-17004.html

最新回复(0)