3

I have tried with the following code. I have used to "useLibrary 'org.apache.http.legacy' in build.gradle's android part but error is still appearing , and I have also org.apache.http.legacy.jar in \Android\sdk\platforms\android-23\optional.

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary  'org.apache.http.legacy'

defaultConfig {
    applicationId "com.example.bhuvneshgautam.cityretails"
    minSdkVersion 14
    targetSdkVersion 23
    versionCode 1
    versionName "1.0"
}

enter image description hereenter image description here Does anyone have a solution?

Bhunnu Baba
  • 1,742
  • 15
  • 22

1 Answers1

2

Remove

android {
    useLibrary 'org.apache.http.legacy'
}

block then copy jar and paste into your_application/app/libs/ then include compile fileTree(dir: 'libs', include: ['*.jar']) in dependencies

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    ...
    ...
}

then clean and rebuild the project

Rohit Patil
  • 1,068
  • 8
  • 9