Module was compiled with an incompatible version of Kotlin.

现象:The errors indicate that there are modules compiled with different versions of Kotlin than the one expected by the current project.

Specifically, the expected version is 1.1.15, but we have modules compiled with metadata versions 1.7.1, 1.6.0, and 1.5.1.

一、问题:运行spring boot项目时,idea报出错误:时提示报错如下图:

错误代码:

Error:Kotlin: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.16.

二、产生原因:

这个报错大概意思:模块是用不兼容的Kotlin版本编译的。

原来是idea的kotlin插件版本比pom中的低。

三、解决思路:

把项目里面的版本降一下

一种是升级下idea插件的版本

四、解决办法:

升级Kotlin版本有两种方法步骤如下:

然后清除缓存重启,问题解决;

总结:原因为idea版本旧默认的kotlin版本低,与当前springboot里的ketlin版本冲突导致

相关推荐
alexhilton13 分钟前
使用FunctionGemma进行设备端函数调用
android·kotlin·android jetpack
日月云棠6 小时前
各版本JDK对比:JDK 25 特性详解
java
用户8307196840827 小时前
Spring Boot 项目中日期处理的最佳实践
java·spring boot
JavaGuide7 小时前
Claude Opus 4.6 真的用不起了!我换成了国产 M2.5,实测真香!!
java·spring·ai·claude code
IT探险家7 小时前
Java 基本数据类型:8 种原始类型 + 数组 + 6 个新手必踩的坑
java
花花无缺7 小时前
搞懂new 关键字(构造函数)和 .builder() 模式(建造者模式)创建对象
java
lhDream8 小时前
Kotlin 开发者必看!JetBrains 开源 LLM 框架 Koog 快速上手指南(含示例)
kotlin
用户908324602738 小时前
Spring Boot + MyBatis-Plus 多租户实战:从数据隔离到权限控制的完整方案
java·后端
桦说编程8 小时前
实战分析 ConcurrentHashMap.computeIfAbsent 的锁冲突问题
java·后端·性能优化
RdoZam8 小时前
Android-封装基类Activity\Fragment,从0到1记录
android·kotlin