arrow-kt / arrow-analysis

Arrow Analysis Plugin
https://arrow-kt.io/docs/meta/analysis/
Apache License 2.0
28 stars 3 forks source link

NoSuchMethod error during compileKotlin #67

Open martijnvanderwoud opened 10 months ago

martijnvanderwoud commented 10 months ago

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):

vicfran commented 6 months ago

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 commented 5 months ago

Same issue with Kotlin 2.0