This question already has an answer here:
- org.apache.http.entity.FileEntity is deprecated in Android 6 (Marshmallow) 3 answers
I am using useLibrary 'org.apache.http.legacy' in my build.gradle but some imports are not working
Here are my imports:
import org.apache.http.HttpEntity; // Working
import org.apache.http.HttpResponse; // Working
import org.apache.http.client.ClientProtocolException; // Not Working
import org.apache.http.client.methods.HttpPost; // Not Working
import org.apache.http.impl.client.DefaultHttpClient; // Not Working
import org.apache.http.params.BasicHttpParams; // Working
Here is my build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.user.app"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:23.1.0'
compile 'org.apache.httpcomponents:httpcore:4.4.3'
}