android studio 2022.3.1.19 windows 无法解析所有文件进行配置错误

android studio 2022.3.1.19 windows Could not resolve all files for configuration Error

提问人:hadi 提问时间:9/7/2023 更新时间:9/7/2023 访问量:59

问:

我使用 android studio 2022.3.1.19 Windows 的最新更新 我从“空视图活动”开始了第一个项目,我会说如果我选择带有喷气背包组合的“空活动”,我不会有任何错误 我的 Gradle 与绿色绿色勾号同步,当我想运行应用程序时,发生了此错误

Caused by: org.gradle.api.internal.artifacts.ivyservice.DefaultLenientConfiguration$ArtifactResolveException: Could not resolve all files for configuration':app:debugRuntimeClasspath'.

请帮我解决这个问题

这是我的build.gradle.kts(:app)

plugins {
id("com.android.application")
id("org.jetbrains.kotlin.android")
}

android {
namespace = "com.example.myapplication"
compileSdk = 33

    defaultConfig {
        applicationId = "com.example.myapplication"
        minSdk = 21
        targetSdk = 31
        versionCode = 1
        versionName = "1.0"
    
        testInstrumentationRunner = "androidx.test.runner.AndroidJUnitRunner"
    }
    
    buildTypes {
        release {
            isMinifyEnabled = false
            proguardFiles(
                getDefaultProguardFile("proguard-android-optimize.txt"),
                "proguard-rules.pro"
            )
        }
    }
    compileOptions {
        sourceCompatibility = JavaVersion.VERSION_1_8
        targetCompatibility = JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = "1.8"
    }

}

dependencies {

    implementation("androidx.core:core-ktx:1.9.0")
    implementation("androidx.appcompat:appcompat:1.6.1")
    implementation("com.google.android.material:material:1.8.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")

}

//这是我的build.gradle.kts(我的应用程序)

// Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id("com.android.application") version "8.1.1" apply false
    id("org.jetbrains.kotlin.android") version "1.9.0-RC" apply false
}

我尝试运行该应用程序,但它不适用于此错误

kotlin android-studio android-gradle-plugin build.gradle gradle-kotlin-dsl

评论

0赞 Chirag Thummar 9/8/2023
尝试将版本升级到 17Java

答: 暂无答案