我試圖使用Kotlin腳本將我的project之一遷移到Gradle。Gradle kotlin腳本,>找不到id爲`kotlin`的插件
這是我的步驟:
- 取代
/gradle/wrapper/gradle-wrapper.jar
與this one - 更新的
gradle/wrapper/gradle-wrapper.properties
的distributionUrl
到相同here - 創建的對應
build.gradle.kts
- 設置
settings.gradle
到rootProject.buildFileName = 'build.gradle.kts'
在這一點上的IntelliJ檢測到它,並建議:
You can configure Gradle wrapper to use distribution with sources. It will provide IDE with Gradle API/DSL documentation.
- >確定,應用建議!
Gradle 'hello-kotlin' project refresh failed
Error:Plugin with id 'kotlin' not found.
於是我也試着嘗試官方samples之一:
- 克隆回購
- 打開的示例
- 同樣的錯誤
...我是什麼我做錯了?
我回來官方樣品,試圖無效緩存和重新啓動,也沒有工作
我試圖刪除
apply {
plugin("kotlin")
}
刷新搖籃,再次添加它,刷新搖籃,它工作
如果我打開一個src的文件,說的IntelliJ:
Kotlin not configured
^h H但是樣品似乎現在正在運行..
的IntelliJ 2017.1 EAP
科特林1。1m04
您使用的是什麼版本的IDEA kotlin插件? – IRus
2017.1,build IC-171.2014.21 – elect
在工具 - > Kotlin - >配置Kotlin Plugin Updates中進行檢查。爲了使用Kotlin Script Gradle 1.1版本,需要 – IRus