解决方案

福利推荐-办理成功后可加微信领取20红包

Module was compiled with an incompatible version of Kotlin.

2023-08-08 11:38:13 michael007js 478

问题描述

提示:在项目build的时候报了以下错误:
kotlin-stdlib-common.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.4.2.

解决方案:

在项目工程下的build.gradle中,将ext.kotlin_version 改成 ‘1.6.0’

buildscript {
   ext.kotlin_version = '1.6.0'
   repositories {
       google()
       mavenCentral()
 }

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

allprojects {
   repositories {
       google()
       mavenCentral()
 }
}

rootProject.buildDir = '../build'
subprojects {
   project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
   project.evaluationDependsOn(':app')
}

task clean(type: Delete) {
   delete rootProject.buildDir
}


首页
关于博主
我的博客
搜索