[英]GradlePluginKotlinVersion inadequate?
当我尝试为 cordova-android 9.1.0 使用特定的 Kotlin 版本时,我收到如下错误消息:
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.6.0, expected version is 1.1.15.
这是由于使用:
<preference name="GradlePluginKotlinVersion" value="1.6.0" />
如果我在 build.gradle 文件中手动将 1.3.50 ext.kotlin_version 值替换为 1.6.0,则我的项目开始成功构建。
如何使用我想要的 Kotlin 版本使构建工作,而无需进行此编辑?
I had the same problem on Cordova 9 and wasn't able to resolve it since Cordova 9 has kotlin v 1.3.50 hardcoded in the build.gradle
file.
所以我升级到 Cordova 10.1.0,问题就解决了。
cordova platform remove android
cordova platform add android@10.1.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.