Ошибка: не удалось разрешить все файлы для конфигурации

Я добавил библиотеку jsoup в свой проект Android, но продолжаю получать сообщение об ошибке, что студия Android не может разрешить все файлы для конфигурации. Изображение

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    implementation 'com.android.support:design:26.1.0'
    implementation 'com.android.support:support-v4:26.1.0'
    compile 'com.google.firebase:firebase-firestore:11.8.0'
    compile 'com.google.firebase:firebase-auth:11.8.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'
    apply plugin: 'com.google.gms.google-services'
    implementation files('C:/Users/Administrator/Documents/GitHub/project1/jsoup-1.11.2.jar')
    implementation files('C:/Users/Aviv/Documents/GitHub/project1/jsoup-1.11.2.jar')
    implementation files('C:/Users/Aviv/Documents/GitHub/project1/gradle/wrapper/jsoup-1.11.2.jar')
    implementation files('jsoup-1.11.2.jar')
}

Вывод на консоль Gradle

Error:Could not resolve all files for configuration ':app:debugAndroidTestRuntimeClasspath'.
> Failed to transform file 'jsoup-1.11.2.jar' to match attributes {artifactType=android-classes} using transform JarTransform
> Transform output file C:\Users\Administrator\Documents\GitHub\project1\jsoup-1.11.2.jar does not exist.
> Failed to transform file 'jsoup-1.11.2.jar' to match attributes {artifactType=android-classes} using transform JarTransform
> Transform output file C:\Users\Aviv\Documents\GitHub\project1\jsoup-1.11.2.jar does not exist.
> Failed to transform file 'jsoup-1.11.2.jar' to match attributes {artifactType=android-classes} using transform JarTransform
> Transform output file C:\Users\Aviv\Documents\GitHub\project1\gradle\wrapper\jsoup-1.11.2.jar does not exist.
0
0
3 706
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

Баночка должна находиться в папке libs, а не находиться вне каталога.

  1. Создайте новую папку в папке вашего приложения с именем libs.
  2. Поместите jsoup-1.11.2.jar в эту папку libs.
  3. В вашем build.gradle измените это

    implementation files('libs/jsoup-1.11.2.jar')

Также обратите внимание, что эта строка ниже также импортирует все файлы jar в каталог libs.

implementation fileTree(include: ['*.jar'], dir: 'libs')

Другие вопросы по теме