【发布时间】:2022-09-23 15:12:25
【问题描述】:
我是 Kotlin 的新手,我刚刚在 Android Studio 中使用 Kotlin 创建了我的第一个应用程序。但是,我在下面收到此错误消息。我无法启动,因为我的应用程序无法构建。我已经尝试过Invalidate Caches/Restart但没有任何反应。
JDK版本:11.0.16.1, Android Studio 版本:3.4.1
ERROR: Unable to resolve dependency for \':app@debug/compileClasspath\': Failed to
transform artifact \'annotation-experimental.aar (androidx.annotation:annotation-
experimental:1.3.0)\' to match attributes {artifactType=jar}
Affected Modules: app
ERROR: Unable to resolve dependency for \':app@debugAndroidTest/compileClasspath\':
Failed to transform artifact \'annotation-experimental.aar
(androidx.annotation:annotation-experimental:1.3.0)\' to match attributes
{artifactType=jar}
Affected Modules: app
ERROR: Unable to resolve dependency for \':app@debugUnitTest/compileClasspath\': Failed
to transform artifact \'annotation-experimental.aar (androidx.annotation:annotation-
experimental:1.3.0)\' to match attributes {artifactType=jar}
Affected Modules: app
ERROR: Unable to resolve dependency for \':app@release/compileClasspath\': Failed to
transform artifact \'annotation-experimental.aar (androidx.annotation:annotation-
experimental:1.3.0)\' to match attributes {artifactType=jar}
Affected Modules: app
ERROR: Unable to resolve dependency for \':app@releaseUnitTest/compileClasspath\':
Failed to transform artifact \'annotation-experimental.aar
(androidx.annotation:annotation-experimental:1.3.0)\' to match attributes
{artifactType=jar}
Affected Modules: app
我的依赖:
dependencies {
implementation fileTree(dir: \'libs\', include: [\'*.jar\'])
implementation\"org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version\"
implementation \'androidx.appcompat:appcompat:1.5.1\'
implementation \'androidx.core:core-ktx:1.9.0\'
implementation \'androidx.constraintlayout:constraintlayout:2.1.4\'
testImplementation \'junit:junit:4.12\'
androidTestImplementation \'androidx.test:runner:1.4.0\'
androidTestImplementation \'androidx.test.espresso:espresso-core:3.4.0\'
}
标签: android android-studio kotlin