Kotlin plugin compiled with later Kotlin version in 261.21525.39-EAP-SNAPSHOT

I use a custom build for my plugin, and after updating my IntelliJ SDK to 261.21525.39-EAP-SNAPSHOT, I now get a bunch of errors like the following:

error: incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
/Users/colin/.sdks/261.21525.39-EAP-SNAPSHOT/plugins/Kotlin/lib/kotlin-plugin.jar!/META-INF/analysis-api-fe10.kotlin_module: error: module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 2.4.0, expected version is 2.2.0.

and

src/kotlin/cursive/psi/reference/ReferenceContributors.kt:115:41: error: class 'org.jetbrains.kotlin.psi.KtCallExpression' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.4.0, but the compiler version 2.2.0 can read versions up to 2.3.0.
The class is loaded from /Users/colin/.sdks/261.21525.39-EAP-SNAPSHOT/plugins/Kotlin/lib/kotlinc.kotlin-compiler-common.jar!/org/jetbrains/kotlin/psi/KtCallExpression.class
          val call = arglist.parent as? KtCallExpression ?: return PsiReference.EMPTY_ARRAY
                                        ^^^^^^^^^^^^^^^^
src/kotlin/cursive/psi/reference/ReferenceContributors.kt:119:24: error: class 'org.jetbrains.kotlin.psi.KtCallExpression' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.4.0, but the compiler version 2.2.0 can read versions up to 2.3.0.
The class is loaded from /Users/colin/.sdks/261.21525.39-EAP-SNAPSHOT/plugins/Kotlin/lib/kotlinc.kotlin-compiler-common.jar!/org/jetbrains/kotlin/psi/KtCallExpression.class
          val callee = call.calleeExpression ?: return PsiReference.EMPTY_ARRAY
                       ^^^^

It only seems to be the Kotlin plugin that suffers from this, everything else works as normal. I’m using Kotlin 2.2.20, which still seems to be the recommended version for 261.

Hi Colin,

unfortunately it’s indeed impossible to use kotlin 2.2.20 anymore for 261. 2.3.0/2.3.10 should be used instead. Could you please point me where do we recommend 2.2.20 or do you mean the template for a new plugin project?

Thanks for letting us know.

Anna

Well, the current version of the Gradle plugin uses it for all IntelliJ versions:

(there’s no 261 branch details, so it will pick the latest, i.e. 253). So as I understand it, plugins which integrate with the Kotlin plugin cannot be built using the Gradle plugin as of the latest 261 release.

Similarly, the docs at Configuring Kotlin Support | IntelliJ Platform Plugin SDK have not been updated for 261 yet, so I’m not sure where this information would be communicated.

I thought I had checked the bazel file too, but looking at it now it does indeed use 2.3.10 RC - perhaps I looked at an earlier 261 tag by mistake: intellij-community/lib/MODULE.bazel at 261.21525 · JetBrains/intellij-community · GitHub

I think, you can specify 2.3.10 manually in build.gradle.kts and it should actually work fine. The map `PlatformKotlinVersions` should be updated indeed, I’ve pinged the authors.