Fehler in build.gradle

  • Antworten:9
  • Bentwortet
Robbiani Renato
  • Forum-Beiträge: 602

12.03.2022, 21:41:42 via Website

Hallo zusammen

Mein App lässt sich nicht mehr ausführen. Ich kann den Code nicht mehr Fehlerfrei compilieren. Wenn ich die App starten möchte, kommt folgender Fehler:

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.

Ich habe im Internet nach geschaut und keine Lösung finden können die das Problem behebt.
Ich habe das Projekt bereits mit Clean Project gelöscht und mit Sync project mit Gradle File neu angelegt. Wenn ich nun rebuild project mache, werden diese Fehler angezeigt.

Executing tasks: [clean, :app:assembleDebug] in project C:\Users\renato\Documents\Android-Studio\KCK_App

Task :clean UP-TO-DATE
Task :app:clean
Task :app:preBuild UP-TO-DATE
Task :app:preDebugBuild UP-TO-DATE
Task :app:mergeDebugNativeDebugMetadata NO-SOURCE
Task :app:compileDebugAidl NO-SOURCE
Task :app:compileDebugRenderscript NO-SOURCE
Task :app:generateDebugBuildConfig
Task :app:javaPreCompileDebug
Task :app:checkDebugAarMetadata FAILED
Task :app:generateDebugResValues
Task :app:generateDebugResources
Task :app:mergeDebugResources FAILED
Task :app:createDebugCompatibleScreenManifests
Task :app:extractDeepLinksDebug
Task :app:processDebugMainManifest FAILED
Task :app:mergeDebugShaders
Task :app:compileDebugShaders NO-SOURCE
Task :app:generateDebugAssets UP-TO-DATE
Task :app:mergeDebugAssets FAILED
Task :app:processDebugJavaRes NO-SOURCE
Task :app:mergeDebugJavaResource FAILED
Task :app:checkDebugDuplicateClasses FAILED
Task :app:desugarDebugFileDependencies FAILED
Task :app:mergeDebugJniLibFolders
Task :app:mergeDebugNativeLibs FAILED
Task :app:validateSigningDebug
Task :app:writeDebugAppMetadata
Task :app:writeDebugSigningConfigVersions

FAILURE: Build completed with 8 failures.

1: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugAarMetadata'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

2: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugResources'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

3: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:processDebugMainManifest'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

4: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugAssets'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

5: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugJavaResource'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

6: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:checkDebugDuplicateClasses'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

7: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:desugarDebugFileDependencies'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

8: Task failed with an exception.

  • What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.google.guava:listenablefuture:1.0.
    Searched in the following locations:

  • Try:

    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

  • Get more help at https://help.gradle.org

BUILD FAILED in 771ms
20 actionable tasks: 19 executed, 1 up-to-date

Ich kann mir nicht mehr helfen. Weiss jemand wie ich das Projekt wieder zum laufen bringen kann?

Gruss Renato

Kommentieren
Beste Antwort
Robbiani Renato
  • Forum-Beiträge: 602

20.03.2022, 21:55:10 via Website

Hallo zusammen

Ich weiss nicht ob es wirklich die Lösung des Problems ist, aber nun läuft mein Projekt wieder.
Ich habe folgende Zeile "mavenCentral()" unter dem "allprojects".

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Gruss Renato

Hilfreich?
Kommentieren
Ludy
  • Admin
  • Forum-Beiträge: 7.957

12.03.2022, 23:17:58 via App

hi,

schau in der gradle nach

com.google.guava:listenablefuture:1.0

wenn dahinter ein Punkt ist, dann entfernen

oder hier Mal schauen: https://developer.android.com/guide/background/listenablefuture#kts

— geändert am 12.03.2022, 23:23:59

Gruß Ludy (App Entwickler)

Mein Beitrag hat dir geholfen? Lass doch ein "Danke" da.☺

☕ Buy Me A Coffee ☕

Lebensmittelwarnung-App

✨Meine Wunschliste✨

📲Telegram NextPit News📲

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

13.03.2022, 20:00:28 via Website

Ciao Ludy

Danke für deine Hilfe. Leider bringt es keine Besserung. Das Problem muss anderswo liegen.

Gruss Renato

Hilfreich?
Kommentieren
Rafael K.
  • Forum-Beiträge: 2.359

14.03.2022, 07:55:17 via Website

Interessant ist doch dieser Teil der Fehlermeldung:

Required by:
project :app > androidx.constraintlayout:constraintlayout:2.1.3 > androidx.core:core:1.7.0 > androidx.concurrent:concurrent-futures:1.0.0

Vermutlich wird diese Guava Lib also als transitive Dependency von ConstraintLayout gezogen.
Scheinbar fehlt ihm dabei ein Repo.

Wie sieht denn deine build.gradle aus? Ich meine die im Root Verzeichnis des Projekts.

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

18.03.2022, 21:36:14 via Website

Ciao Rafael

Bringt leider auch nichts.
Irgend wie muss es an der Installation liegen. Denn ich habe dasselbe Problem unter Linux wie auf Windows. Einige Projekte laufen andere nicht. Aber ich finde den Unterschied nicht.

Gruss Renato

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

20.03.2022, 21:25:39 via Website

Ja habe ich ganz vergessen. Und schon ist es da :

apply plugin: 'com.android.application'

android {
compileSdkVersion 32
defaultConfig {
applicationId "ch.robbisoft.kck_app"
minSdkVersion 21
targetSdkVersion 32
versionCode 29
versionName '2.6.4'
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '31.0.0 rc2'
}

dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support.constraint:constraint-layout:2.0.4'
implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation 'androidx.core:core:1.7.0'
implementation 'androidx.concurrent:concurrent-futures:1.1.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.5.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}

Gruss Renato

Hilfreich?
Kommentieren
Beste Antwort
Robbiani Renato
  • Forum-Beiträge: 602

20.03.2022, 21:55:10 via Website

Hallo zusammen

Ich weiss nicht ob es wirklich die Lösung des Problems ist, aber nun läuft mein Projekt wieder.
Ich habe folgende Zeile "mavenCentral()" unter dem "allprojects".

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
google()
mavenCentral()

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

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
google()
mavenCentral()
}
}

task clean(type: Delete) {
delete rootProject.buildDir
}

Gruss Renato

Hilfreich?
Kommentieren
Robbiani Renato
  • Forum-Beiträge: 602

21.03.2022, 10:31:11 via Website

Genau so lässt sich das Problem lösen.

Herzlichen Dank allen, welche mit gedacht haben und mir geholfen haben das Problem zu lösen.

Gruss Renato

Hilfreich?
Kommentieren