Android Studio构建遇Gradle CircularReferenceException问题求助
Android Studio构建项目时出现CircularReferenceException问题求助
问题概述
在Android Studio构建项目时触发了CircularReferenceException,无法确定问题源于Gradle配置还是依赖项,具体报错如下:
报错详情
循环依赖任务::app:processDebugResources
--- :app:processDebugResources (*)
异常堆栈:
org.gradle.api.CircularReferenceException: Circular dependency between the following tasks: :app:processDebugResources --- :app:processDebugResources (*)
相关文件内容
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools"> <application android:allowBackup="true" android:dataExtractionRules="@xml/data_extraction_rules" android:fullBackupContent="@xml/backup_rules" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" android:theme="@style/Theme.E_commerce_Application" tools:targetApi="31"> <activity android:name=".orderConfirmation" android:exported="false" /> <activity android:name=".BILLInfo" android:exported="false" /> <activity android:name=".payment" android:exported="false" /> <activity android:name=".art" android:exported="false" /> <activity android:name=".toys" android:exported="false" /> <activity android:name=".skincare" android:exported="false" /> <activity android:name=".kitchenware" android:exported="false" /> <activity android:name=".clothes" android:exported="false" /> <activity android:name=".food" android:exported="false" /> <activity android:name=".HomePage" android:exported="false" /> <activity android:name=".SignUp" android:exported="false" /> <activity android:name=".MainActivity" android:exported="true"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
build.gradle.kts(:app)
plugins { id("com.android.application") id("com.google.gms.google-services") } android { namespace = "com.example.e_commerce_application" compileSdk = 34 defaultConfig { applicationId = "com.example.e_commerce_application" minSdk = 24 targetSdk = 34 versionCode = 1 versionName = "1.0" testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner" } buildFeatures{ dataBinding = true viewBinding = true } buildTypes { release { isMinifyEnabled = false proguardFiles( getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro" ) } } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } } dependencies { implementation("androidx.appcompat:appcompat:1.6.1") implementation("com.google.android.material:material:1.11.0") implementation("androidx.constraintlayout:constraintlayout:2.1.4") implementation("com.google.firebase:firebase-auth:22.3.1") implementation("com.google.firebase:firebase-database:20.3.1") implementation(project(":app")) testImplementation("junit:junit:4.13.2") androidTestImplementation("androidx.test.ext:junit:1.1.5") androidTestImplementation("androidx.test.espresso:espresso-core:3.5.1") // Import the BoM for the Firebase platform implementation(platform("com.google.firebase:firebase-bom:32.8.0")) implementation("com.google.firebase:firebase-database") // implementation("androidx.cardview:cardview:1.0.0") }
已尝试的解决方式
- 修改buildtools版本
- 参考技术教程排查问题,但未解决
内容的提问来源于stack exchange,提问作者rucha_0803
相关产品推荐
相关产品推荐

