我正在尝试 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.
大概 Kotlin 的 Gradle 和 IntelliJ 版本需要匹配,但是安装的 Kotlin 插件是:1.0.0-rc-1007-IJ143-11
我在任何公共存储库中都没有看到这一点。我在gradle项目中声明的最新的是:
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 存储库:
repositories {
// ...
maven { url 'https://dl.bintray.com/kotlin/kotlin-eap/' }
}
to both buildscript
和项目部分。
另外,你的kotlin_version
是不正确的,它不应该有-IJ143-11
部分。使用1.0.0-rc-1025
.
另一个解决方案是将 Kotlin 插件回滚到 Beta 版本,这涉及删除它(plugins
IDEA 安装的子文件夹,因为它预安装在 EAP 16 中)并从 ZIP 发行版再次安装 Beta。
要了解有关 EAP 构建的更多信息,请参阅这个话题 https://discuss.kotlinlang.org/t/kotlin-early-access-preview-updated/1437.
UPD:
RC 已与工件一起发布。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)