Kotlin gradle Could not initialize class class org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt

前端 未结 10 2006
天涯浪人
天涯浪人 2020-12-30 18:10

I tried to use gradle for transpiling Kotlin to Js. When I run the example from https://www.codeflow.site/fr/article/kotlin-javascript I got the error : Could not initia

相关标签:
10条回答
  • 2020-12-30 19:09

    It seems it is a problem with different Ktlin verion as explained in Building Kotlin projects with Gradle sometimes fails with NoClassDefFoundError

    0 讨论(0)
  • 2020-12-30 19:11

    Yes, as many before have said, the problem is probably that you have a kotlin version mis-match. But how do you know what version of kotlin is installed?

    To find out your version of kotlin: Settings -> Language & Frameworks -> Kotlin

    Make sure that you change your kotlin version (in both build.gradle files!) to this exact number. In my case (above) it's 1.4.10

    Good luck!

    0 讨论(0)
  • 2020-12-30 19:12

    update your Version in your gradle.properties file. eg) kotlinVersion=1.3.72

    0 讨论(0)
  • 2020-12-30 19:13

    Simplest solution:

    Go to file -> project structure (ctrl+shift+alt+s) -> suggestions -> accept all the suggestions.

    To answer the OP's quetion, you just need to accept the one with the kotlin version

    0 讨论(0)
提交回复
热议问题