获取 IntelliJ Kotlin 插件和 gradle 以匹配

Get IntelliJ Kotlin plugin and gradle to match up

我正在尝试 IntelliJ 16,抢先体验版,但我的项目无法编译:

Error:(16, 17) Kotlin: Unresolved reference: substring
(note: this may be caused by the fact that some classes compiled with 
an incompatible version of Kotlin were found in the classpath. Such 
classes cannot be loaded properly by this version of Kotlin compiler. 

大概 Gradle 和 IntelliJ 版本的 Kotlin 需要匹配,但安装的 Kotlin 插件是:1.0.0-rc-1007-IJ143-11

我在任何 public 存储库中都没有看到这个。我在 gradle 项目中声明的最新一个是:

buildscript {
    ext.kotlin_version = ' 1.0.0-rc-1007-IJ143-11'

。 . IntelliJ 16 可以与 Kotlin 和 Gradle 一起使用吗?

简而言之,Kotlin IDEA 插件 RC(1.0.0-rc-100710171025)与 Beta 库不兼容,并且 RC 库构建还没有在 Maven Central 上。

要使用它们,您必须添加 EAP 存储库:

repositories {
    // ...
    maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
}

buildscript 和项目部分。

此外,您的 kotlin_version 不正确,不应该有 -IJ143-11 部分。使用 1.0.0-rc-1025.

另一个解决方案是将 Kotlin 插件回滚到 Beta 版本,这涉及删除它(IDE​​A 安装的 plugins 子文件夹,因为它预装在 EAP 16 中)并从 ZIP 分发版再次安装 Beta。

要了解有关 EAP 构建的更多信息,请参阅 this topic


更新:

RC 已与工件一起发布。