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
相关产品推荐
相关产品推荐

