You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Android Studio集成colorpicker依赖报错:无法解析debugRuntimeClasspath

无法解析Jitpack上的colorpicker依赖:ModuleVersionNotFoundException

我在给Android应用添加颜色选择器时,引入依赖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.

我已经完成以下排查操作:

  • 确认网络连接正常
  • 尝试清理项目缓存并重新构建
  • 核对依赖的写法完全准确
  • 已在settings.gradle的repositories中添加Jitpack仓库配置:
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        maven { url 'https://jitpack.io' }
    }
}

我的app/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'
}

注释掉该colorpicker依赖后,应用可以正常运行。

内容的提问来源于stack exchange,提问作者kiteandwindsurfer

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.04 20:22:34