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
  • 179,855
  • 19
  • 132
  • 245
Teja
  • 837
  • 3
  • 14
  • 24

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
  • 19
  • 40