According to kotlin-dsl-samples/samples at master · gradle/kotlin-dsl-samples · GitHub, one should be able to use vanilla Intellij 2017.1.4 and vanilla Kotlin plugin 1.1.2-5 to open a build.gradle.kts-based project. I tried to open the hello-world sample project in Intellij. While command-line ./gradlew clean build works and produces the .jar file properly, opening the build.gradle.kts file in Intellij will make it all red and autocompletion/navigation/documentation doesn’t work. Please, what further steps do I need to take, for the build.gradle.kts to work properly?
I am seeing this issue now, I think I have all the latest stuff…
kotlin_version = “1.2.0”
distributionUrl=https://services.gradle.org/distributions/gradle-4.3-bin.zip
kotlin plugin 1.2.0-release-IJ2017.3-1
IntelliJ IDEA 2017.3 (Ultimate Edition)
Build #IU-173.3727.127, built on November 27, 2017
I used the New Module wizard to set it up and selected the kotlin dsl.
I’m finding this issue quite annoying. Seems even with Gradle 4.4 I have to randomly add/remove the plugin java part to make it parse. Once it parses it’s okay until the next time I load up IntelliJ IDEA.
I’m only a few days into all of Kotlin, Idea, and Gradle, so am having a bit of information overload. My build.gradle.kts file is not parsing and is marked red as well. Does this matter? What do I need to do to fix it if so? I have fresh installs of everything.
I’ve the same issue on Windows. I’m also on latest versions Gradle 4.4.1, IDEA 2017.3.2, kotlin 1.2.10
It’s fair to say that everything work fine right after I create a new project. After I close the project and re-open it the script file never compiles. Tips from other threads like removing gradle caches don’t work.