【发布时间】:2021-12-03 07:13:55
【问题描述】:
当我尝试运行这个基本应用程序时,我收到“无法解析所有配置文件 ':app:debugRuntimeClasspath'。”
gradle.build(应用程序)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-parcelize'
android {
compileSdkVersion 31
defaultConfig {
applicationId "hellokotlinandroid.gohool.com.buttonstextviewedittext"
minSdkVersion 21
targetSdkVersion 31
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:3.0.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation "org.jetbrains.kotlin:kotlin-stdlib-jre7"
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
testImplementation 'junit:junit:4.13.2'
}
gradle.build(项目)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.5.31'
repositories {
maven { url 'https://maven.google.com' }
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.0.3'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.6.0-RC'
}
repositories {
mavenCentral()
google()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
}
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
compileTestKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
allprojects {
repositories {
maven { url 'https://maven.google.com' }
mavenCentral()
google()
}
}
这是完整的错误
1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.6.0-RC.
Searched in the following locations:
- https://maven.google.com/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.6.0-RC/kotlin-stdlib-jre7-1.6.0-RC.pom
- https://repo.maven.apache.org/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.6.0-RC/kotlin-stdlib-jre7-1.6.0-RC.pom
- https://dl.google.com/dl/android/maven2/org/jetbrains/kotlin/kotlin-stdlib-jre7/1.6.0-RC/kotlin-stdlib-jre7-1.6.0-RC.pom
Required by:
project :app
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
此错误重复多次,准确地说是 17 次,是同一件事,但每次的任务略有不同
我已经浏览了论坛并尝试了他们所说的但似乎找不到任何东西并尝试了所有基本的故障排除 任何建议表示赞赏,谢谢!
【问题讨论】:
标签: android android-studio kotlin error-handling