Gradle failed to sync with 'unable to find optional library'

前端 未结 9 2384
刺人心
刺人心 2020-12-01 18:24

I had to reinstall my system and today I get this error in Android Studio when I try to sync with gradle:

Warning: Unable to find optional library: org.apach         


        
9条回答
  •  萌比男神i
    2020-12-01 19:01

    Top level build.gradle - /build.gradle

    buildscript {
    ...
    dependencies {
        classpath 'com.android.tools.build:gradle:1.3.1'
    }
    }
    

    Module specific build.gradle - /app/build.gradle

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

    Add org.apache.http.legacy.jar which is in Android/Sdk/platforms/android-23/optional folder to app/libs directory and sync your project

提交回复
热议问题