Could not resolve all files for configuration ':app:debugRuntimeClasspath

Viewed 525

I am getting some error

Execution failed for task ':app:desugarDebugFileDependencies'. Could not resolve all files for configuration ':app:debugRuntimeClasspath'. Could not find com.google.guava:listenablefuture:1.0.

And Show Something like that as well Required by: project :app > androidx.appcompat:appcompat:1.4.0 > androidx.core:core:1.7.0 > androidx.concurrent:concurrent-futures:1.0.0

How can I solve that issue. Please Some one Help Me

Here is My Build.gradle

apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'

android {
compileSdkVersion 31
defaultConfig {
    applicationId "com.example.bloodbuddy"
    minSdkVersion 21
    targetSdkVersion 31
    versionCode 6
    versionName "2.0.1"
    testInstrumentationRunner "androidx.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
buildFeatures {
    viewBinding true
}
}

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

implementation 'androidx.appcompat:appcompat:1.4.0'
implementation 'com.google.android.material:material:1.4.0'
implementation("androidx.constraintlayout:constraintlayout:2.1.2")
implementation 'com.google.firebase:firebase-database:20.0.3'
implementation 'com.google.firebase:firebase-auth:21.0.1'


implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'com.google.firebase:firebase-storage:20.0.0'



testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'

}
1 Answers

Have you found the answer? Because you didn't show your project root build.gradle and maybe the build.gradle in your project root directory didn't have the mavenCentral() repository.

Just go to your build.gradle repository and add the mavenCentral().

Project root directory build.gradle

buildscript {
    repositories {
        google()
        mavenCentral() // <= add this
    }
    dependencies {
        // make sure to have this classpath
        classpath 'com.google.gms:google-services:4.3.10'
    }
}

........

allprojects {
    repositories {
        google()
        mavenCentral() // <= add this
    }
}

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