javaandroidandroid-studiocolor-picker

Android Studio error with colorpicker: Could not resolve all files for configuration :app:debugRuntimeClasspath


I am adding a color picker to my app. When I run the app with this dependency:

`implementation 'com.github.duanhong169:colorpicker:1.1.7'`

I am consistently getting the red font error messages:


    ArtifactResolveException: Could not resolve all files for configuration :app:debugRuntimeClasspath.

and also:


    Caused by: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find com.github.duanhong169:colorpicker:1.1.7.

Checking that these are operative:


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

Here is build.gradle:


    plugins {
        id 'com.android.application'
    }
    
    android {
        namespace 'com.enetapplications.songtracker'
        compileSdk 34
    
        defaultConfig {
            applicationId "com.enetapplications.songtracker"
            minSdkVersion 29
            targetSdkVersion 34
            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
        }
    }
    dependencies {
        // ... existing dependencies ...
    
        implementation 'androidx.appcompat:appcompat:1.6.1'
        implementation 'com.google.android.material:material:1.10.0'
        implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
        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.activity:activity:1.8.1'
        implementation 'androidx.fragment:fragment:1.6.2'
        implementation 'androidx.appcompat:appcompat:1.6.1'
        implementation 'androidx.core:core-ktx:1.12.0'
        implementation 'androidx.fragment:fragment-ktx:1.6.2'
        implementation "androidx.preference:preference:1.2.1"
        implementation 'com.github.duanhong169:colorpicker:1.1.7'
    
    }

I can run the app if I comment out this dependency:


    implementation 'com.github.duanhong169:colorpicker:1.1.7'


Solution

  • The issue - at least in my instance - seems to be the colorpicker here, even trying earlier versions did not solve (most current as of this writing seems to be 1.1.7):

    implementation 'com.github.duanhong169:colorpicker:1.1.7'
    

    I was able to work-around this simply by choosing a different colorpicker, the one that seems working without gradle or any other errors is:

    implementation 'com.github.yukuku:ambilwarna:2.0.1'