无法使用kotlin-multipatform项目 [英] Can't use kotlin-multipatform project

查看:109
本文介绍了无法使用kotlin-multipatform项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试在Intellij Idea Community 2019.2.3中创建我的第一个Kotlin多平台项目.

I try to create my first Kotlin multiplatform project in Intellij Idea Community 2019.2.3.

使用了默认的IDE项目: 在此处输入图片描述

Was used default IDE project: enter image description here

但是,即使是默认项目构建,也有类似 ko

But even default project build with exception like this ko

我的版本: 科尔坦1.3.50 gradle:4.4.1 Groovy:2.4.16

my versions: koltin 1.3.50 gradle: 4.4.1 Groovy: 2.4.16

怎么了?我该如何解决?

What's wrong? How can I fix it?

推荐答案

您需要更新Gradle版本.用于构建多平台项目的kotlin-multiplatform插件仅与Gradle 4.7及更高版本兼容,如

You need to update the Gradle version. The kotlin-multiplatform plugin that is used to build multiplatform projects is only compatible with Gradle versions 4.7 and above, as said in the reference.

考虑使用最新的Gradle版本(目前为5.​​6.2版,请在此处),这也可能会带来更好的性能和其他好处.

Consider using an up-to-date Gradle version (Gradle 5.6.2 at the moment, check for updates here), which will also likely give better performance and other benefits.

要更新版本,请在项目中修改gradle/wrapper/gradle-wrapper.properties,替换为distributionUrl属性.例如,该行可能看起来像:

To update the version, modify gradle/wrapper/gradle-wrapper.properties in your project, replacing the distributionUrl property. For instance, the line could look like:

distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.2-bin.zip

或者,如果您不使用Gradle包装器,则只需从较新的版本发行版中调用gradle.

Or, if you are not using a Gradle wrapper, just call gradle from a newer version distribution.

这篇关于无法使用kotlin-multipatform项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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