[英]GradlePluginKotlinVersion inadequate?
When I try to use a specific Kotlin version for cordova-android 9.1.0, I get error messages like:当我尝试为 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.
That results from using:这是由于使用:
<preference name="GradlePluginKotlinVersion" value="1.6.0" />
If I manually replace the 1.3.50 ext.kotlin_version values with 1.6.0 in the build.gradle files, then my project starts building successfully.如果我在 build.gradle 文件中手动将 1.3.50 ext.kotlin_version 值替换为 1.6.0,则我的项目开始成功构建。
How can I make the build work, with my desired Kotlin version, without having to make this edit?如何使用我想要的 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. 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.
So I upgraded to Cordova 10.1.0 and the issue was solved.所以我升级到 Cordova 10.1.0,问题就解决了。
cordova platform remove android
cordova platform add android@10.1.0
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.