昨日可正常编译的项目今日无法编译,求助解决依赖问题
解决Glide 4.8.0依赖解析失败问题
针对你遇到的Could not resolve all dependencies for configuration ':sp:spDebugRuntimeClasspath'及Could not determine artifacts for com.github.bumptech.glide:glide:4.8.0报错,尝试以下方案:
检查仓库配置
确保项目已配置Maven Central仓库(JCenter已停止服务,无法正常拉取旧依赖):
新版Android Studio(Arctic Fox及以上)修改settings.gradle:dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() } }旧版本修改根目录
build.gradle:allprojects { repositories { google() mavenCentral() // 注释掉jcenter(),避免拉取失败 } }清理本地Gradle缓存
手动删除Gradle缓存目录后重新构建:- Windows:
C:\Users\<你的用户名>\.gradle\caches - Mac/Linux:
~/.gradle/caches
- Windows:
更换Glide稳定版本
4.8.0版本较老,尝试替换为更新的稳定版(如4.15.1),修改模块build.gradle:implementation 'com.github.bumptech.glide:glide:4.15.1' annotationProcessor 'com.github.bumptech.glide:compiler:4.15.1'同步后重新构建。
排查网络/代理问题
检查Android Studio代理设置(File > Settings > System Settings > HTTP Proxy),确认代理配置正确,或关闭代理使用直连网络重试。
内容的提问来源于stack exchange,提问作者Bishal Poddar
相关产品推荐
相关产品推荐

