Android Studio中出现“Module was compiled with an incompatible version of Kotlin”错误
你好!我是Android开发和Kotlin的新手。最近我将Android Studio更新到了最新版本,之后我的项目就无法构建了。出现了如下错误:
```
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.5.1, expected version is 1.1.16
```
我使用的插件和库如下,这是我的`build.gradle`(项目级别):
```kotlin
buildscript {
ext.kotlin_version = "1.3.72"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:4.1.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
```
以及模块级别的文件(app/build.gradle):
```kotlin
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
android {
compileSdkVersion 30
defaultConfig {
applicationId "com.example.myapp"
minSdkVersion 21
```