Android Studio 颜色选择器错误:无法解析所有配置文件:app:debugRuntimeClasspath

问题描述 投票:0回答:1

我正在向我的应用程序添加一个颜色选择器。当我运行具有此依赖项的应用程序时:

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

我不断收到红色字体的错误消息:


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

还有:


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

检查这些是否有效:

  • 互联网功能齐全

  • 尝试清理和重建项目

  • 检查了颜色选择器的依赖符号,它是准确的

  • 尝试添加到

    repositories
    ,如下所示(
    settings.gradle
    ):


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

这是

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

如果我注释掉此依赖项,我可以运行该应用程序:


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

java android android-studio color-picker
1个回答
0
投票

问题 - 至少在我的例子中 - 似乎是这里的颜色选择器,即使尝试早期版本也没有解决(截至本文撰写时最新版本似乎是 1.1.7):

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

我可以通过选择不同的颜色选择器来解决这个问题,看起来没有 gradle 或任何其他错误的颜色选择器是:

implementation 'com.github.yukuku:ambilwarna:2.0.1'
© www.soinside.com 2019 - 2024. All rights reserved.