I have an error writing this in my buil.gradle of my volley module that matters:
useLibrary 'org.apache.http.legacy'
Once I write that line and synchronize the project again it shows me this error:
Error: Unable to find optional library: org.apache.http.legacy
I'm using the volley library, this is the buil.gradle of the volley module:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
}
}
plugins {
id "com.github.sherter.google-java-format" version "0.6"
id "net.ltgt.errorprone" version "0.0.13"
}
googleJavaFormat {
toolVersion = '1.5'
options style: 'AOSP'
}
apply plugin: 'com.android.library'
repositories {
jcenter()
}
group = 'com.android.volley'
version = '1.1.1-SNAPSHOT'
android {
compileSdkVersion 25
buildToolsVersion = '26.0.2'
useLibrary 'org.apache.http.legacy'
}
apply from: 'rules.gradle'
apply from: 'bintray.gradle'
This is my Module: app :
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.enriq.examen_tareas_segundo_planp_enrique_espinosa"
minSdkVersion 15
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
}
And finally my buil.gradle :
// Top-level build file where you can add configuration options common
to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
} }
allprojects {
repositories {
google()
jcenter()
} }
task clean(type: Delete) {
delete rootProject.buildDir }