“模块是用不兼容的 Kotlin 版本编译的.其元数据的二进制版本为 1.5.1,预期版本为 1.1.16"; [英] "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"

查看:40
本文介绍了“模块是用不兼容的 Kotlin 版本编译的.其元数据的二进制版本为 1.5.1,预期版本为 1.1.16";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是 Kotlin 应用开发的初学者.当我尝试构建应用程序时出现以下错误 -

I am a beginner in Kotlin App Development. The following error is occurred when I tried to build the app -

e: C:/Users/Lenovo/.gradle/caches/transforms-2/files-2.1/32f0bb3e96b47cf79ece6482359b6ad2/jetified-kotlin-stdlib-jdk7-1.5.0.jar!/META-INF-indtkojdk7.kotlin_module:模块是用不兼容的 Kotlin 版本编译的.其元数据的二进制版本为 1.5.1,预期版本为 1.1.16

e: C:/Users/Lenovo/.gradle/caches/transforms-2/files-2.1/32f0bb3e96b47cf79ece6482359b6ad2/jetified-kotlin-stdlib-jdk7-1.5.0.jar!/META-INF/kotlin-stdlib-jdk7.kotlin_module: 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

是关于更新模块吗?那怎么更新呢?

Is it about updating the module? Then how to update it?

推荐答案

从 Kotlin 1.4.30 更新到 1.5.0 时发生在我身上.似乎是某种 Gradle 缓存问题.我能够通过将 Gradle6.7.1 更新到 6.9(或任何其他版本)来解决它.

Happened to me when updating from Kotlin 1.4.30 to 1.5.0. Seems to be some sort of Gradle caching issue. I was able to resolve it by updating Gradle from 6.7.1 to 6.9 (or any other version).

只需转到 gradle-wrapper.properties 并将这一行从

Just go to gradle-wrapper.properties and change this line from

distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-all.zip

distributionUrl=https://services.gradle.org/distributions/gradle-6.9-all.zip

distributionUrl=https://services.gradle.org/distributions/gradle-6.9-all.zip

这篇关于“模块是用不兼容的 Kotlin 版本编译的.其元数据的二进制版本为 1.5.1,预期版本为 1.1.16";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆