Home > database >  Could not resolve all files for configuration ':app:debugCompileClasspath'. when trying to
Could not resolve all files for configuration ':app:debugCompileClasspath'. when trying to

Time:06-15

I am trying to use a library that can choose images from gallery, but i am having the following error. Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app: debugCompileClasspath'.

The library that I am using is : implementation 'com.github.esafirm.android-image-picker:imagepicker:2.4.5'

my build gradle file :

    id 'com.android.application'
    id 'kotlin-android'
    id 'kotlin-kapt'
    id "androidx.navigation.safeargs"

}

android {
    compileSdk 32

    defaultConfig {
        applicationId "application name"
        minSdk 26
        targetSdk 32
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    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'
    }
    dataBinding {
        enabled = true
    }

}

kapt {
    generateStubs = true
}

dependencies {
    implementation 'androidx.room:room-common:2.4.2'
    def daggerVersion = '2.21'

    implementation 'androidx.core:core-ktx:1.7.0'
    implementation 'androidx.appcompat:appcompat:1.4.1'
    implementation 'com.google.android.material:material:1.5.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
    implementation 'androidx.legacy:legacy-support-v4:1.0.0'
    testImplementation 'junit:junit:4. '
    androidTestImplementation 'androidx.test.ext:junit:1.1.3'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
    implementation 'androidx.recyclerview:recyclerview:1.2.1'

    //navigation
    implementation 'androidx.navigation:navigation-fragment-ktx:2.4.2'
    implementation 'androidx.navigation:navigation-ui-ktx:2.4.2'
    implementation "androidx.fragment:fragment-ktx:1.4.1"

    //Lifecycle ViewModel and LiveData
    implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
    implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1'
    implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.3.1"

    // Dagger dependencies

    implementation 'com.google.dagger:dagger:'   daggerVersion
    implementation 'com.google.dagger:dagger-android:'   daggerVersion
    implementation 'com.google.dagger:dagger-android-support:'   daggerVersion
    kapt 'com.google.dagger:dagger-android-processor:'   daggerVersion
    kapt 'com.google.dagger:dagger-compiler:'   daggerVersion

    //BlurView
    implementation 'com.eightbitlab:blurview:1.6.6'

    //SDP - a scalable size unit
    implementation 'com.intuit.sdp:sdp-android:1.0.6'

    //FlexBoxLayout
    implementation 'com.google.android.flexbox:flexbox:3.0.0'

    //View Pager dots
    implementation 'com.tbuonomo:dotsindicator:4.3'

    //Retrofit
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'com.squareup.retrofit2:retrofit:2.9.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.9.0'

    // Room
    def roomVersion = "2.4.0"
    implementation "androidx.room:room-runtime:$rootProject.roomVersion"
    kapt "androidx.room:room-compiler:$rootProject.roomVersion"
    implementation "androidx.room:room-ktx:$rootProject.roomVersion"
    testImplementation "androidx.room:room-testing:$rootProject.roomVersion"

    // Coroutines
    api "org.jetbrains.kotlinx:kotlinx-coroutines-core:$rootProject.coroutines"
    api "org.jetbrains.kotlinx:kotlinx-coroutines-android:$rootProject.coroutines"

    //Facebook SDK
    implementation 'com.facebook.android:facebook-login:12.3.0'

    //Google Services
    implementation 'com.google.android.gms:play-services-auth:20.2.0'

    //Glide
    implementation 'com.github.bumptech.glide:glide:4.13.0'
    annotationProcessor 'com.github.bumptech.glide:compiler:4.13.0'

    //View More TextView
    implementation "it.mike5v:viewmore-textview:1.1.3"
    
    //Tooltip
    implementation 'com.tomergoldst.android:tooltips:1.0.10'

    //EasyPermissions
    implementation 'pub.devrel:easypermissions:1.1.3'

    //Rounded image
    implementation 'com.makeramen:roundedimageview:2.3.0'

    implementation("org.greenrobot:eventbus:3.3.1")

    //Image Picker
//    implementation 'com.github.esafirm:android-image-picker:3.0.0-beta1'

    implementation 'com.github.esafirm.android-image-picker:imagepicker:2.4.5'
}

My build gradle project file :

buildscript {
    repositories {
        google()
        mavenCentral()
        maven { url "https://jitpack.io" }
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.4"
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2"
        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
    }
}

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

ext {
    roomVersion = '2.4.2'
    coroutines = '1.4.3'
}

CodePudding user response:

You need to add jitpack to allprojects:

buildscript {
    repositories {
        google()
        mavenCentral()
    }
    dependencies {
        classpath "com.android.tools.build:gradle:7.0.4"
        classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.21'
        classpath "androidx.navigation:navigation-safe-args-gradle-plugin:2.4.2"
        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 {
        maven { url "https://jitpack.io" }
    }
}

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

ext {
    roomVersion = '2.4.2'
    coroutines = '1.4.3'
}

After that you most probably would have gradle dep resolution issue. To fix it you would need to delete dependencyResolutionManagement in settings.gradle

Or you can keep dependencyResolutionManagement and add maven { url 'https://jitpack.io' } directly there instead of repositories in root gradle file. This is preferable way to do

dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}
  • Related