获取IntelliJ Kotlin插件和gradle匹配
我正在尝试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
)与Beta库不兼容,而RC库build也不在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版本,包括删除它( plugins
IDEA安装的子文件夹,因为它已经预装在EAP 16中)并且从ZIP发行版中再次安装Beta。
要了解有关EAP构建的更多信息,请参阅此主题 。
UPD:
RC已经与工件一起被释放。
- 用Android Studio 3.0 Canary 4构建错误
- Android Studio 3.0中的Plain Kotlin模块,`api`不支持?
- Gradle kotlin不支持的方法Dependencies.getAtoms()
- Gradle kotlin-spring插件不能打开spring类
- 多项目构建中的Gradle – 路径
- Kotlin脚本为Gradle配置 – 传递参数不使用扩展名
- 如何将ext。*变量转换为build.gradle.kts中的插件块
- Kotlin的gradle插件不适用于自定义源集(JMH)
- :在Gradle(混合Java + Kotlin项目)中compileKotlin失败