1

When i use this in gradle it is showing as

"Error:Unable to find optional library: org.apache.http.legacy"

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.2"
    useLibrary 'org.apache.http.legacy'
    defaultConfig {
        applicationId "com.xxxxxxx.xxxxxxx"
        minSdkVersion 15
        targetSdkVersion 23
    }

......

}

Project Level :

buildscript {
    repositories {
        jcenter()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:2.1.0'
    }
}

allprojects {
    repositories {
        jcenter()
    }
}
OneCricketeer
  • 151,199
  • 17
  • 111
  • 216
Teja
  • 709
  • 3
  • 11
  • 23

1 Answers1

-1

Add org.apache.http.legacy.jar which is in Android/Sdk/platforms/android-23/optional folder to app/libs directory and sync your project. Check this Link as this question looks similar.

Community
  • 1
  • 1
Ironman
  • 1,330
  • 2
  • 15
  • 36