Kotlin-dsl-samples: Can no longer run `hello-kotlin` sample application from IntelliJ

Created on 21 Feb 2017  路  6Comments  路  Source: gradle/kotlin-dsl-samples

After the update to the latest snapshot distro it's no longer possible to run the hello-kotlin sample from Intellij. It fails with:

Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
    at samples.HelloWorldKt.main(HelloWorld.kt)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:497)
    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 6 more

Ilya Gorbunov had the following to say about a similar failure in another project:

I've tried to import your project and seems all dependencies are imported with Provided scope.

hello-kotlin failure screen shot

bug gradle-dist blocking project-import superseded

Most helpful comment

This is actually an IntelliJ issue.

All 6 comments

This is actually an IntelliJ issue.

so what is the solution?

@Roshankd1 Upgrade to IntelliJ IDEA 2017.1 or superior.

@bamboo thanks for replying, I am actually trying to use this in Android studio 3.1
Is it possible?

Hm, it seems a similar bug is still present in Android Studio 3.1.3:

Error: Could not find or load main class samples.HelloWorldKt

@bamboo exactly i didnt want to load my pc with all the intellij :( and i have Xcode haha

Was this page helpful?
0 / 5 - 0 ratings