Jakub Chrzanowski
07/28/2025, 7:38 PM8.14.3 to 9.0.0-rc-4.
When running integration tests against Gradle 8.x, the plugin fails on java.lang.NoSuchMethodError and java.lang.NoClassDefFoundError.
In my code, I rely on sequenceOf() and yield(), whose signatures slightly changed in Kotlin 2.0:
sequenceOf()
* Exception is:
java.lang.NoSuchMethodError: 'kotlin.sequences.Sequence kotlin.sequences.SequencesKt.sequenceOf(java.lang.Object)'
at org.jetbrains.intellij.platform.gradle.resolvers.path.ModuleDescriptorsPathResolver.<init>(ModuleDescriptorsPathResolver.kt:19)
at Build_gradle.<init>(build.gradle.kts:53)
yield()
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':signPlugin'.
....
Caused by: java.lang.NoClassDefFoundError: kotlin/coroutines/jvm/internal/SpillingKt
at org.jetbrains.intellij.platform.gradle.tasks.SignPluginTask$arguments$1.invokeSuspend(SignPluginTask.kt:208)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
My first though was to build the Gradle plugin targeting Kotlin 1.8 (we support Gradle 8.5+) using:
kotlin {
jvmToolchain(17)
compilerOptions {
apiVersion = KotlinVersion.KOTLIN_1_8
languageVersion = KotlinVersion.KOTLIN_1_8
}
}
but this didn't really help. Any ideas on how to deal with that?Martin
07/28/2025, 9:10 PMcoreLibrariesVersionVampire
07/28/2025, 9:17 PMMartin
07/28/2025, 9:23 PMapiVersion doesn't cover this is a major oversight IMO but I'll still have this over semi colons any time ;-)Martin
07/28/2025, 9:24 PMJakub Chrzanowski
07/28/2025, 9:39 PMJakub Chrzanowski
07/28/2025, 9:53 PMtasks.withType<KotlinCompile>().configureEach {
compilerOptions {
apiVersion.set(KotlinVersion.KOTLIN_1_8)
languageVersion.set(KotlinVersion.KOTLIN_1_8)
}
}Vampire
07/28/2025, 10:29 PM-release. 🤷♂️Vladimir Sitnikov
07/29/2025, 5:36 AMMartin
07/29/2025, 7:03 AMVampire
07/29/2025, 7:03 AMcoreLibrariesVersion to compile against the old API? 🤔Martin
07/29/2025, 7:04 AMMartin
07/29/2025, 7:04 AMMartin
07/29/2025, 7:05 AMMartin
07/29/2025, 7:05 AMkotlin-stdlib:2.2 in your compile classpath?Vampire
07/29/2025, 7:09 AM-release, but isn't, I see. :-)Martin
07/29/2025, 7:12 AMlanguageVersion). It's tempting to try to map the concept but I find it easier to look at them differently.
Why there is both apiVersion and coreLibrariesVersion is a mistake IMOMartin
07/29/2025, 7:14 AMMartin
07/29/2025, 7:14 AMapiVersion should control the version of stdlib or so (basically KT-58998)Jakub Chrzanowski
07/29/2025, 7:16 AMkotlin-dsl which overrides on the task's level (ref) the apiVersion and languageVersion set via extension.Jakub Chrzanowski
07/29/2025, 7:17 AMMartin
07/29/2025, 7:19 AM