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

NoSuchMethod error during compileKotlin #67

Open
martijnvanderwoud opened this issue Feb 1, 2024 · 2 comments
Open

NoSuchMethod error during compileKotlin #67

martijnvanderwoud opened this issue Feb 1, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@martijnvanderwoud
Copy link

Describe the bug
Adding the arrow analysis gradle plugin results in a NoSuchMethodError exception when we try to compile our project

To Reproduce
Steps to reproduce the behavior:

  1. Add id("io.arrow-kt.analysis.kotlin") version "2.0.2" to the gradle plugins section
  2. Try to build your project
  3. See that the compileKotlin task fails with "java.lang.NoSuchMethodError: 'void org.jetbrains.kotlin.ir.util.KotlinLikeDumpOptions.(boolean, boolean, boolean, boolean, org.jetbrains.kotlin.ir.util.LabelPrintingStrategy, org.jetbrains.kotlin.ir.util.FakeOverridesStrategy, boolean, int, kotlin.jvm.internal.DefaultConstructorMarker)'"

Expected behavior
Compilation should succeed without exceptions

Environment (please complete the following information):

  • Kotlin version 1.9.22 (jvm)
@martijnvanderwoud martijnvanderwoud added the bug Something isn't working label Feb 1, 2024
@vicfran
Copy link

vicfran commented May 8, 2024

Hello!

I had same issue with that configuration.

TL;DR
The 2.0.2 version depends on 1.6.1-alpha.5 version of arrow-meta which depends on 1.6.20 version of kotlin.

As a workaround, if downgrading kotlin version on your project to 1.6.20 has sense for you, it should solve that build issue.

I think the build error is related to different signatures of KotlinLikeDumpOptions between those versions of kotlin.

1.6.20
https://github.com/JetBrains/kotlin/blob/v1.6.20/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt#L55C7-L55C28
1.9.22
https://github.com/JetBrains/kotlin/blob/v1.9.22/compiler/ir/ir.tree/src/org/jetbrains/kotlin/ir/util/dumpKotlinLike.kt#L59

The higher version of kotlin available at arrow-meta is 1.9.21, available with 1.6.3-alpha.2 but the higher version of arrow-meta available at arrow-analysis is 1.6.2.
Support for kotlin 1.9.22 is not available yet, but seems no difference between 1.9.21 and 1.9.22, at least for that issue, so it should be enough.

This issue should be fixed after upgrading arrow-meta dependency version to 1.6.3-alpha2 or higher if available.

@DmitriyZaitsev
Copy link

Same issue with Kotlin 2.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants