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

Gradle任务循环依赖问题::app:processDebugResources自依赖报错

解决org.gradle.api.CircularReferenceException循环依赖问题

问题出在你的dependencies配置里——你重复添加了两次implementation project(path: ':app'),这导致app模块自依赖,Gradle在构建时会认为模块需要依赖自身才能完成构建任务,进而触发CircularReferenceException错误,和你修改的buildTools版本没有关系。

修正后的dependencies代码如下:

dependencies {
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.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.recyclerview:recyclerview:1.2.1"
    implementation "androidx.cardview:cardview:1.0.0"
}

删除那两行自依赖配置后,重新同步Gradle即可解决循环依赖问题。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.17 18:57:13