【问题标题】:Can't use kotlin-multipatform project无法使用 kotlin-multipatform 项目
【发布时间】:2020-01-29 15:37:48
【问题描述】:
我尝试在 Intellij Idea Community 2019.2.3 中创建我的第一个 Kotlin 多平台项目。
使用了默认的 IDE 项目:
enter image description here
但即使是默认项目构建也会出现这样的异常ko
我的版本:
科尔廷 1.3.50
等级:4.4.1
Groovy:2.4.16
怎么了?我该如何解决?
【问题讨论】:
标签:
gradle
kotlin
kotlin-multiplatform
【解决方案1】:
您需要更新 Gradle 版本。用于构建多平台项目的kotlin-multiplatform 插件仅与Gradle 4.7 及更高版本兼容,如said in the reference。
考虑使用最新的 Gradle 版本(目前是 Gradle 5.6.2,请检查更新 here),这也可能会带来更好的性能和其他好处。
要更新版本,请修改项目中的gradle/wrapper/gradle-wrapper.properties,替换distributionUrl 属性。例如,该行可能如下所示:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip
或者,如果您不使用 Gradle 包装器,只需从较新版本的发行版中调用 gradle。