Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NoSuchMethodError in project that uses Kotlinx Benchmark and KGP 2.0 #236

Open
adam-enko opened this issue Jul 4, 2024 · 0 comments
Open

Comments

@adam-enko
Copy link
Member

kotlinx-benchmark uses a utility to create a new D8Exec task.

private fun Project.createD8Exec(
config: BenchmarkConfiguration,
target: BenchmarkTarget,
compilation: KotlinJsIrCompilation,
taskName: String
): TaskProvider<D8Exec> = D8Exec.create(compilation, taskName) {

However, the signature of this method changed in KGP 2.0

https://github.com/JetBrains/kotlin/blob/9589486e67c5867b41ed6c58c9614aff39633fe3/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/js/d8/D8Exec.kt#L54

compilation: KotlinJsCompilation changed to compilation: KotlinJsIrCompilation

This causes a failure during Gradle project configuration.

FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring root project 'junit2932190119581877902'.
> Failed to notify project evaluation listener.
   > 'org.gradle.api.tasks.TaskProvider org.jetbrains.kotlin.gradle.targets.js.d8.D8Exec$Companion.create(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation, java.lang.String, kotlin.jvm.functions.Function1)'

* Try:
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Exception is:
org.gradle.api.ProjectConfigurationException: A problem occurred configuring root project 'junit2932190119581877902'
[...]
Caused by: java.lang.NoSuchMethodError: 'org.gradle.api.tasks.TaskProvider org.jetbrains.kotlin.gradle.targets.js.d8.D8Exec$Companion.create(org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJsCompilation, java.lang.String, kotlin.jvm.functions.Function1)'
	at kotlinx.benchmark.gradle.JsEngineExecTasksKt.createD8Exec(JsEngineExecTasks.kt:113)
qurbonzoda added a commit that referenced this issue Jul 24, 2024
Fixes issue #236.
Eventually, the plugin should use the version of Kotlin embedded into Gradle.
woainikk pushed a commit that referenced this issue Jul 24, 2024
Fixes issue #236.
Eventually, the plugin should use the version of Kotlin embedded into Gradle.
woainikk pushed a commit that referenced this issue Jul 25, 2024
Fixes issue #236.
Eventually, the plugin should use the version of Kotlin embedded into Gradle.
woainikk pushed a commit that referenced this issue Sep 4, 2024
Fixes issue #236.
Eventually, the plugin should use the version of Kotlin embedded into Gradle.
woainikk pushed a commit that referenced this issue Sep 23, 2024
Fixes issue #236.
Eventually, the plugin should use the version of Kotlin embedded into Gradle.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant