获取IntelliJ Kotlin插件和gradle以匹配 [英] Get IntelliJ Kotlin plugin and gradle to match up

查看:2727
本文介绍了获取IntelliJ Kotlin插件和gradle以匹配的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试IntelliJ 16,早期的访问版本,但是我的项目不能编译:

 错误:( Kotlin:无法解析的引用:子字符串
(注意:这可能是由于在类路径中发现了一些使用
编译了不兼容版本的Kotlin的类,这样的
类这个版本的Kotlin编译器无法正确加载

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



I在gradle项目中声明的最新版本是:

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

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

解决方案

总之,Kotlin IDEA插件RC( 1.0 .0-rc-1007 1017 1025 )与Beta库不兼容,而RC库版本也不在Maven Central中。



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

 存储库{
// ...
maven {url'https://dl.bintray.com/kotlin/kotlin-eap/'}
}

buildscript 和项目部分。

另外,你的 kotlin_version 不正确,它不应该有 -IJ143-11 部分。使用 1.0.0-rc-1025



另一种解决方案是将Kotlin插件回滚到Beta版本,包括将其删除(IDEA安装的 plugins 子文件夹,因为它已预安装在EAP 16中),并再次从ZIP分发版安装Beta。



要详细了解EAP构建,请参阅这个主题






UPD:



RC已经与工件一起发布。


I'm trying IntelliJ 16, early access version, but my project won't compile with:

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

I don't see this in any public repository. The latest one I have declared in the gradle project is:

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

. . can IntelliJ 16 be used with Kotlin and 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.

To use them, you have to add the EAP repository:

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

to both buildscript and the project part.

Also, your kotlin_version is incorrect, it shouldn't have -IJ143-11 part. Use 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.

To learn more about EAP builds, please refer to this topic.


UPD:

The RC has been released along with the artifacts.

这篇关于获取IntelliJ Kotlin插件和gradle以匹配的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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