我将 firebase 添加到我的项目中,当我尝试运行时,它总是给我这个错误。
e: E:/gradle/caches/transforms-3/c0b55b67018ed7528c3fb574e8fcae45/transformed/jetified-play-services-measurement-api-22.0.0-api.jar!/META-INF/java.com.google.android.gmscore.integ.client.measurement_api_measurement_api.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:compileDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction
我多次更新了 kotlin 版本,但还是一样。我找到的解决方案建议更新 kotlin 版本,但它对我不起作用。我的项目使用 vscode。
这是我在 android uild.gradle 中的构建脚本
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:4.4.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
尝试将
ext.kotlin_version
更新为 1.9.0