简体   繁体   English

获取IntelliJ Kotlin插件和gradle进行配对

[英]Get IntelliJ Kotlin plugin and gradle to match up

I'm trying IntelliJ 16, early access version, but my project won't compile with: 我正在尝试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. 

Presumably the Gradle and IntelliJ versions of Kotlin need to match up, but the installed Kotlin plugin is: 1.0.0-rc-1007-IJ143-11 大概是Kotlin的Gradle和IntelliJ版本需要匹配,但是安装的Kotlin插件是: 1.0.0-rc-1007-IJ143-11

I don't see this in any public repository. 我在任何公共存储库中都没有看到这个。 The latest one I have declared in the gradle project is: 我在gradle项目中声明的最新一项是:

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

. . can IntelliJ 16 be used with Kotlin and Gradle? IntelliJ 16可以与Kotlin和Gradle一起使用吗?

In short, Kotlin IDEA plugin RC ( 1.0.0-rc-1007 , 1017 , 1025 ) is incompatible with Beta libraries, and RC libraries builds are not on Maven Central yet. 总之,科特林IDEA插件RC( 1.0.0-rc-100710171025 )与测试版不兼容的库,和RC库版本是不是在Maven的中央呢。

To use them, you have to add the EAP repository: 要使用它们,您必须添加EAP存储库:

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

to both buildscript and the project part. buildscript和项目部分。

Also, your kotlin_version is incorrect, it shouldn't have -IJ143-11 part. 另外,您的kotlin_version不正确,不应包含-IJ143-11部分。 Use 1.0.0-rc-1025 . 使用1.0.0-rc-1025

The other solution is to rollback Kotlin plugin to Beta version, which involves deleting it ( plugins subfolder of IDEA installation, as it is preinstalled in EAP 16) and installing the Beta again from ZIP distribution. 另一个解决方案是将Kotlin插件回滚到Beta版本,这涉及到将其删除(IDEA安装的plugins子文件夹,因为它预先安装在EAP 16中),然后从ZIP发行版中再次安装Beta。

To learn more about EAP builds, please refer to this topic . 要了解有关EAP构建的更多信息,请参考本主题


UPD: UPD:

The RC has been released along with the artifacts. RC已与工件一起发布。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM