Pre release version problem with kotlin in Intellij

Hello,

I try to use kotlin with intellij with the last version of the kotlin intellij plugin

This is for being able to write gradle script using kotlin.

But that not working, I have this error message when i try to use the kotlin API

"“Class ‘’{0}‘’ is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler”

I use intellij 2016.3.4 and the kotlin toolkit plugin 1.1.0-rc-91-IJ2016.3-1 which is apparently the most recent I can have.

I use this exenple : kotlin-dsl-samples/samples/hello-kotlin at master · gradle/kotlin-dsl-samples · GitHub

I have this error in the build.gradle.kts file but also in the src/main/kotlin/samples/helloworld.kt.

Does anyone has an idea ?

thanks

The Gradle folks need to publish a new release of Gradle Script Kotlin built with Kotlin 1.1 RC. Once they do that, the problem will be resolved.

So, let’s wait ^^

Does it happened? How I could update in my existing project?

How I could add wrapper task as it was in groovy version of gradle.build script?

Eeh, it seems it is IntelliJ Idea replace
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-4.0-20170523130707+0000-bin.zip
to incorrect distributionUrl=https\://repo.gradle.org/gradle/dist-snapshots/gradle-script-kotlin-4.0-20170523130707+0000-all.zip on project import or refresh.

It works with console ./gradlew.

How it may be fixed?

1 Like