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

Viewed 1082

I searched a lot, but I don't have a solution for this problem :

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

and this error :

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

I allready tried all solutions but not working.

Error :

error

build.gradle(project)

// Top-level build file where you can add configuration options common to all sub- 
projects/modules.
buildscript {
ext.kotlin_version = "1.6.20"
repositories {
    google()
    jcenter()

}
dependencies {
    classpath 'com.android.tools.build:gradle:7.1.2'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    classpath 'com.google.gms:google-services:4.3.10'

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

allprojects {
repositories {
    google()

    mavenCentral()

    maven {
        url "https://jitpack.io"
    }
}
}

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

build.gradle(Module) :

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


android {
compileSdkVersion 32

defaultConfig {
    applicationId "com.myapp.medled"
    minSdkVersion 22
    targetSdkVersion 32
    versionCode 1
    versionName "1.0"

    testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard- 
rules.pro'
    }
}
}

dependencies {

def nav_version = "2.4.2"
def room_version = "2.5.0"
def archLifecycleVersion = '2.5.0-beta01'

implementation "androidx.room:room-runtime:2.4.2"
implementation 'com.google.firebase:firebase-database:20.0.4'
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
testImplementation "androidx.room:room-testing:$room_version"

implementation "androidx.lifecycle:lifecycle-extensions:$archLifecycleVersion"
kapt "androidx.lifecycle:lifecycle-compiler:2.4.2"
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.5.0-beta01")
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.0-beta01")

implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.1'
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation("androidx.core:core-ktx:1.7.0")

implementation 'androidx.appcompat:appcompat:1.4.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
implementation("androidx.navigation:navigation-runtime-ktx:2.4.2")
implementation("androidx.navigation:navigation-fragment-ktx:2.4.2")
implementation("androidx.navigation:navigation-ui-ktx:2.4.2")

implementation "androidx.navigation:navigation-dynamic-features-fragment:$nav_version"

implementation 'com.google.firebase:firebase-auth:21.0.3'
androidTestImplementation "androidx.navigation:navigation-testing:$nav_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation platform('com.google.firebase:firebase-bom:29.3.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.legacy:legacy-support-core-utils:1.0.0'
}
1 Answers

This Error Is caused by one of your dependencies to solve this issue go to your build.gradle file and review all of your dependencies and check if the version is correct or any other typo mistake Probably one of them does not point correctly to its repository, I hope this can help you..

Related