[英]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.