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

前端 未结 9 2398
刺人心
刺人心 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条回答
  •  情话喂你
    2020-12-01 19:03

    You need to add org.apache.http.legacy.jar jar file in your Android Stuido project's app/libs folder.

      Jar Location - `\android-sdk\platforms\android-23\optional`  
    

    To do this, just right click on your project and select Show in Explorer then go to ...\app\libs and paste above jar file and Sync your Project with Gradle File

    Module:app

    android {
    compileSdkVersion 'Google Inc.:Google APIs:23'
    buildToolsVersion "24.0.0"
    defaultConfig {
        applicationId ""
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    }
    

提交回复
热议问题