my android project doesn't contain build.gradle to put useLibrary 'org.apache.http.legacy'
Asked
Active
Viewed 710 times
0

manfcas
- 1,933
- 7
- 28
- 47

user343733
- 1
- 2
-
click on the project button as seen in the image, you'll have option to switch to 'android' there. Then you can see the gradle scripts – OBX Feb 05 '17 at 09:28
-
which IDE are you using? eclipse or Android studio? – OBX Feb 05 '17 at 09:28
-
API 23 removed that library. You probably need to compile with a lower Android SDK. – OneCricketeer Feb 05 '17 at 09:28
1 Answers
0
Sample Build.gradle
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 25
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.Sample.App"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.1"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
debuggable false
jniDebuggable false
renderscriptDebuggable false
}
debug {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'),
'proguard-rules.pro'
debuggable true
jniDebuggable true
renderscriptDebuggable true
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.android.support:design:25.1.0'
}

Sabish.M
- 2,022
- 16
- 34