错误:Module was compiled with an incompatible version of Kotlin. The binary version of its metadata

androidstudio升级kotlin之后,build时gradle就爆出了错误: 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.

大概意思是Kotlin版本编译不兼容导致,我根据现有的版本,将build.gradle里面的ext.kotlin_version 改成 '1.5.31'就可以了,这个版本是怎么回事,暂时没有研究

buildscript {
    ext.kotlin_version = '1.5.31'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:3.5.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

你可能感兴趣的:(kotlin,flutter,android,kotlin,android,studio)