Skip to content

Kotlin 2.1 Compatibility Issue #2882

Closed
Closed
@hantsy

Description

After several hours of research yesterday, I found the Kotlinter gradle broke our project build when upgrading Kotlin 2.1.

I tried to fork and update Kotin Kotlinter to Kotlin 2.1 but it did not resolve the issue.

The root cause is from Klint, check the issue discussion here: jeremymailen/kotlinter-gradle#414 (comment)

> Task :lintKotlinIntegration FAILED
lint worker execution error
java.lang.NoClassDefFoundError: org/jetbrains/kotlin/gradle/internal/config/CompilerConfigurationKey
	at org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar$Companion.<clinit>(ComponentRegistrar.kt:33)
	at org.jetbrains.kotlin.compiler.plugin.ComponentRegistrar.<clinit>(ComponentRegistrar.kt)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.registerExtensionsFromPlugins$cli_base(KotlinCoreEnvironment.kt:753)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.registerExtensionsFromPlugins(KotlinCoreEnvironment.kt:194)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.configureProjectEnvironment(KotlinCoreEnvironment.kt:652)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt:224)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment.<init>(KotlinCoreEnvironment.kt)
	at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:468)
	at com.pinterest.ktlint.rule.engine.internal.KotlinPsiFileFactoryKt.initPsiFileFactory(KotlinPsiFileFactory.kt:58)
	at com.pinterest.ktlint.rule.engine.internal.KotlinPsiFileFactoryProvider.getKotlinPsiFileFactory(KotlinPsiFileFactory.kt:32)
	at com.pinterest.ktlint.rule.engine.internal.RuleExecutionContext$Companion.createRuleExecutionContext$ktlint_rule_engine(RuleExecutionContext.kt:212)
	at com.pinterest.ktlint.rule.engine.internal.CodeFormatter.format(CodeFormatter.kt:51)
	at com.pinterest.ktlint.rule.engine.internal.CodeFormatter.format(CodeFormatter.kt:28)
	at com.pinterest.ktlint.rule.engine.api.KtLintRuleEngine.lint(KtLintRuleEngine.kt:91)
	at org.jmailen.gradle.kotlinter.tasks.lint.LintWorkerAction.execute(LintWorkerAction.kt:49)

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions