META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module:模块是使用不兼容的 Kotlin 版本编译的。其元数据的二进制版本是1.9.0,预期版本是1.7.1。
执行 org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction 时发生故障 编译错误。查看日志了解更多详情
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.4.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}
我尝试使用 kotlin 版本 1.7.10 和 1.9.22(最新),但仍然出现此错误。 如何解决这个问题。
也许你最近更新了你的 android studio。更改你的 kotlin 版本。
location--> android/build.gradle
buildscript {
ext.kotlin_version = '1.9.0'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:8.1.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
location--> android/gradle/wrapper/gradle-wrapper.properties
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-all.zip