DCam
DCam

Reputation: 31

error "Could not resolve all files for configuration ':app:debugCompileClasspath'."

I keep changing so many things in my Gradle files and nothing is working so far please help, when I click to run my app on the emulator this is the error I get.

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

build.gradle(:app)

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

android {
    namespace 'com.example.mechanicsapp'
    compileSdk 33
    buildToolsVersion "30.0.3"
    buildFeatures {
        dataBinding true
        viewBinding true
        compose true
    }

    defaultConfig {
        applicationId "com.example.mechanicsapp"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "1.0"

        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'
    }

}


dependencies {

    implementation 'androidx.core:core-ktx:1.9.0'
    implementation 'androidx.appcompat:appcompat:1.6.0'
    implementation 'com.google.android.material:material:1.7.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    implementation 'androidx.navigation:navigation-fragment-ktx:2.5.3'
    implementation 'androidx.navigation:navigation-ui-ktx:2.5.3'
    implementation "androidx.compose.ui:ui:1.3.3"
    implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.5.1'
    implementation 'androidx.activity:activity-compose:1.6.1'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
    implementation "androidx.core:core-ktx:1.9.0"
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.7.21"
    
    //dependencies
    //material design
    implementation 'com.google.android.material:material:1.7.0'
    //circle image view
    implementation 'de.hdodenhof:circleimageview:3.1.0'
    //scalable unit text size
    implementation 'com.intuit.ssp:ssp-android:1.0.6'
    //scalable unit size
    implementation 'com.intuit.sdp:sdp-android:1.0.6'
    //room database
    implementation 'androidx.room:room-runtime:2.5.0'
    kapt 'androidx.room:room-compiler:2.5.0'
    implementation 'androidx.room:room-ktx:2.5.0'
    implementation 'com.makeramen:roundedimageview:2.3.0'
    //crop image library
    implementation 'com.theartofdev.edmodo:android-image-cropper:2.8.0'
    //easy permission
    implementation 'pub.devrel:easypermissions:3.0.0'
    //coroutines core
    implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4'

}

build.gradle(Mechanics App)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '7.4.0' apply false
    id 'com.android.library' version '7.4.0' apply false
    id 'org.jetbrains.kotlin.android' version '1.7.21' apply false
}

repositories {
    google()
    mavenCentral()
    maven { url 'https://maven.google.com' }
}

settings.gradle (MechanicsApp)

pluginManagement {
    repositories {
        google()
        mavenCentral()
        gradlePluginPortal()
    }
}
rootProject.name = "Mechanics App"
include ':app'

Upvotes: 1

Views: 3062

Answers (1)

srinivasan cp
srinivasan cp

Reputation: 9

So in platforms/android/build.gradle file,it should be something like this:

  buildscript {
    
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.1'

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

Upvotes: 0

Related Questions