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

Android构建报错Failed to resolve: com.github.kimchangyoun:rootbeerFresh问题咨询

报错原因
  • 依赖声明缺少版本号:当前rootbeerFresh的依赖配置仅写了包名,末尾没有指定具体版本号,构建工具无法定位对应资源,直接触发解析失败。
  • 未配置对应的依赖仓库:该库托管在JitPack平台,Android项目默认的Google、Maven Central等官方仓库没有收录该包,没有配置JitPack仓库的情况下无法拉取依赖。
解决方法
  1. 补全依赖版本号
    将原有的依赖行修改为指定版本的格式,示例如下:
// root detect
api 'com.github.kimchangyoun:rootbeerFresh:0.1.1'
  1. 添加JitPack仓库配置
    如果使用AGP 7.0及以上版本,在项目根目录的settings.gradle文件中,找到dependencyResolutionManagement下的repositories块,添加JitPack地址:
dependencyResolutionManagement {
    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
    repositories {
        google()
        mavenCentral()
        // 新增JitPack配置
        maven { url 'https://jitpack.io' }
    }
}

如果使用7.0以下的AGP版本,在项目根目录的build.gradle文件中,找到allprojects下的repositories块,添加上述JitPack配置即可。
3. 同步Gradle配置后重新构建项目即可。


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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.10.06 09:51:01