Gradle无法解析:app:debugRuntimeClasspath配置文件问题求助
依赖解析错误:无法解决
:app:debugRuntimeClasspath的所有文件 我碰到这个问题有段时间了,试过切换Gradle离线/在线模式、在项目build.gradle里添加maven { url = uri("https://jitpack.io") }等方法,都解决不了。
说明:项目以Java为主,最近因为Supabase Database SDK需求加了Kotlin代码,所以项目里会同时存在Kotlin和Groovy代码。
错误信息:
Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
项目根目录build.gradle:
buildscript { ext.kotlin_version = '1.9.0' repositories { google() maven { url = uri("https://jitpack.io") } mavenCentral() jcenter() } dependencies { classpath libs.google.services classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" } } plugins { alias(libs.plugins.androidApplication) apply false }
app模块build.gradle:
plugins { alias(libs.plugins.androidApplication) id 'com.google.gms.google-services' id 'kotlin-android' } android { namespace 'com.indiedev91.looksmaxeai_bebetterversion' compileSdk 35 defaultConfig { applicationId "com.indiedev91.looksmaxeai_bebetterversion" minSdk 24 targetSdk 35 versionCode 1 versionName "1.0" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { debug { buildConfigField "String", "API_KEY", "\"your_production_api_key\"" } release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' buildConfigField "String", "API_KEY", "\"your_production_api_key\"" } } buildFeatures { buildConfig = true } compileOptions { sourceCompatibility JavaVersion.VERSION_17 targetCompatibility JavaVersion.VERSION_17 } kotlinOptions { jvmTarget = "17" } java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } } dependencies { implementation libs.appcompat implementation libs.material implementation libs.activity implementation libs.constraintlayout implementation libs.firebase.auth implementation libs.firebase.firestore implementation libs.firebase.crashlytics.buildtools implementation libs.firebase.storage testImplementation libs.junit androidTestImplementation libs.ext.junit androidTestImplementation libs.espresso.core def camerax_version = "1.3.0" implementation libs.camera.core implementation libs.camera.camera2 implementation libs.camera.lifecycle implementation libs.camera.view implementation libs.concurrent.futures.ktx implementation libs.guava // Loading animations implementation 'com.github.ybq:Android-SpinKit:1.4.0' // Circle Image View implementation libs.circleimageview implementation libs.work.runtime //Google Credential Manager implementation libs.credentials implementation libs.credentials.play.services.auth.v150beta01 implementation libs.googleid.v111 implementation libs.core.ktx implementation libs.kotlin.stdlib implementation(libs.bom) implementation("io.github.jan-tennert.supabase:postgrest-kt") implementation("io.github.jan-tennert.supabase:gotrue-kt") implementation("io.ktor:ktor-client-android:3.0.1") }
settings.gradle:
pluginManagement { repositories { google { content { includeGroupByRegex("com\\.android.*") includeGroupByRegex("com\\.google.*") includeGroupByRegex("androidx.*") } } mavenCentral() gradlePluginPortal() } } dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories { google() mavenCentral() maven { url "https://jitpack.io" } jcenter() // Warning: this repository is going to shut down soon } } rootProject.name = "LooksMaxE AI - Be Better Version" include ':app'
更新:libs.versions.toml文件
[versions] agp = "8.3.0" bom = "3.0.1" cameraCore = "1.3.0" circleimageview = "3.1.0" concurrentFuturesKtx = "1.2.0" coreKtx = "1.15.0" credentials = "1.5.0-beta01" credentialsPlayServicesAuth = "1.3.0" credentialsPlayServicesAuthVersion = "1.5.0-beta01" emojislider = "0.3.2" googleid = "1.3.0" googleidVersion = "1.1.1" guava = "29.0-android" junit = "4.13.2" junitVersion = "1.2.1" espressoCore = "3.6.1" appcompat = "1.7.0" kotlinStdlib = "2.0.21" material = "1.12.0" activity = "1.8.0" constraintlayout = "2.1.4" googleServices = "4.4.2" firebaseAuth = "23.1.0" firebaseFirestore = "25.1.1" firebaseCrashlyticsBuildtools = "3.0.2" firebaseStorage = "21.0.1" workRuntime = "2.10.0" [libraries] bom = { module = "io.github.jan-tennert.supabase:bom", version.ref = "bom" } camera-camera2 = { module = "androidx.camera:camera-camera2", version.ref = "cameraCore" } camera-core = { module = "androidx.camera:camera-core", version.ref = "cameraCore" } camera-lifecycle = { module = "androidx.camera:camera-lifecycle", version.ref = "cameraCore" } camera-view = { module = "androidx.camera:camera-view", version.ref = "cameraCore" } circleimageview = { module = "de.hdodenhof:circleimageview", version.ref = "circleimageview" } concurrent-futures-ktx = { module = "androidx.concurrent:concurrent-futures-ktx", version.ref = "concurrentFuturesKtx" } core-ktx = { module = "androidx.core:core-ktx", version.ref = "coreKtx" } credentials = { module = "androidx.credentials:credentials", version.ref = "credentials" } credentials-play-services-auth = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "credentialsPlayServicesAuth" } credentials-play-services-auth-v150beta01 = { module = "androidx.credentials:credentials-play-services-auth", version.ref = "credentialsPlayServicesAuthVersion" } emojislider = { module = "com.bernaferrari.emojislider:emojislider", version.ref = "emojislider" } googleid = { module = "com.google.android.libraries.identity.googleid:googleid", version.ref = "googleid" } googleid-v111 = { module = "com.google.android.libraries.identity.googleid:googleid", version.ref = "googleidVersion" } guava = { module = "com.google.guava:guava", version.ref = "guava" } junit = { group = "junit", name = "junit", version.ref = "junit" } ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "junitVersion" } espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" } appcompat = { group = "androidx.appcompat", name = "appcompat", version.ref = "appcompat" } kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlinStdlib" } material = { group = "com.google.android.material", name = "material", version.ref = "material" } activity = { group = "androidx.activity", name = "activity", version.ref = "activity" } constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" } google-services = { group = "com.google.gms", name = "google-services", version.ref = "googleServices" } firebase-auth = { group = "com.google.firebase", name = "firebase-auth", version.ref = "firebaseAuth" } firebase-firestore = { group = "com.google.firebase", name = "firebase-firestore", version.ref = "firebaseFirestore" } firebase-crashlytics-buildtools = { group = "com.google.firebase", name = "firebase-crashlytics-buildtools", version.ref = "firebaseCrashlyticsBuildtools" } firebase-storage = { group = "com.google.firebase", name = "firebase-storage", version.ref = "firebaseStorage" } work-runtime = { module = "androidx.work:work-runtime", version.ref = "workRuntime" } [plugins] androidApplication = { id = "com.android.application", version.ref = "agp" }
内容的提问来源于stack exchange,提问作者Player91
相关产品推荐
相关产品推荐

