Could not resolve all files for configuration ':app:debugRuntimeClasspath' in android studio

123 Views Asked by At

I have been trying to run my application in android studio but keep getting this error as I run it. The error is described below

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

This is my build.gradle(:app)

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
}

android {
    namespace 'com.example.littlePro'
    compileSdk 33

    defaultConfig {
        applicationId "com.example.littlePro"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "1.0"
        multiDexEnabled true

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary true
        }
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion '1.2.0'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}

dependencies {

    implementation 'com.android.support:multidex:2.0.1'

    implementation "androidx.navigation:navigation-compose:2.7.3"

    implementation 'androidx.core:core-ktx:1.12.0'
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.6.2'
    implementation 'androidx.activity:activity-compose:1.7.2'
    implementation "androidx.compose.ui:ui:$compose_ui_version"
    implementation "androidx.compose.ui:ui-tooling-preview:$compose_ui_version"
    implementation 'androidx.compose.material:material:1.5.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    androidTestImplementation "androidx.compose.ui:ui-test-junit4:$compose_ui_version"
    debugImplementation "androidx.compose.ui:ui-tooling:$compose_ui_version"
    debugImplementation "androidx.compose.ui:ui-test-manifest:$compose_ui_version"
}

and this is build.gradle(LittlePro)

buildscript {
    ext {
        compose_ui_version = '1.2.0'
    }
}    

plugins {
    id 'com.android.application' version '7.4.1' apply false
    id 'com.android.library' version '7.4.1' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.0' apply false
}

I have tried invalidate caches and restart, adding implementation 'com.android.support:multidex:2.0.1' in the dependencies and increased the org.gradle.jvmargs=-Xmx4608m in the gradle.properties. None of the solutions have worked so far. How could I change it to make this work? Thanks

0

There are 0 best solutions below