Kotlin gradle无法初始化类类org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt [英] Kotlin gradle Could not initialize class class org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt
问题描述
我试图使用gradle将Kotlin转换为Js.当我从 https://www.codeflow.site/fr/article/kotlin运行示例时-javascript 我收到了错误消息: 无法初始化来自 build.gradle 的 apply plugin:'kotlin2js'行的org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt 类
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 initialize class org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt which comes from line apply plugin: 'kotlin2js' of build.gradle.
我不知道缺少的类是什么,为什么kotlin2js要求它.有什么建议吗?
I have no idea of what the missing class is and why kotlin2js is asking for it. Any suggestion ?
推荐答案
通过在build.gradle文件中设置最新的Kotlin版本(1.3.72)解决了此问题.
Solved this issue by setting the latest Kotlin version (1.3.72) in build.gradle file.
buildscript {
ext {
kotlinVersion = '1.3.72'
springBootVersion = '2.0.4.RELEASE'
}
repositories {
mavenCentral()
}
...
}
这篇关于Kotlin gradle无法初始化类类org.jetbrains.kotlin.gradle.internal.KotlinSourceSetProviderImplKt的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!