After updating to intellij 2023.3 my plugin is incompatible and does not build anymore

Answered

Build error

.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2023.3/6105b81c6142f62379ad6c5afb542c77350a71eb/ideaIC-2023.3/lib/app-client.jar!/META-INF/intellij.platform.analysis.impl.kotlin_module: Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.9.0, expected version is 1.7.1.

 

build.gradle.kts

plugins {
    id("java")
    id("org.jetbrains.kotlin.jvm") version "1.7.22"
    id("org.jetbrains.intellij") version "1.16.1"
}

group = “mygroup”
version = "1.0.0"

repositories {
    mavenCentral()
}

intellij {
    version.set("2023.3") // updated from 2023.2.2
    type.set("IC")

    plugins.set(listOf("Git4Idea"))
}

dependencies {
    implementation("com.squareup.okhttp3:okhttp:4.10.0")
}

tasks {
    withType<JavaCompile> {
        sourceCompatibility = "17"
        targetCompatibility = "17"
    }
    withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
        kotlinOptions.jvmTarget = "11"
    }

    patchPluginXml {
        sinceBuild.set("231.9392.1")
    }

    signPlugin {
        certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
        privateKey.set(System.getenv("PRIVATE_KEY"))
        password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
    }

    publishPlugin {
        token.set(System.getenv("PUBLISH_TOKEN"))
    }
}
 
0
4 comments

Hi,

Could you please try deleting build and .gradle directories in your project and see if it helps?

Also, why do you target JVM 11 in Kotlin compilation and 17 in Java?

0

I updated kotlinOptions.jvmTarget to 17 and deleted the folders, Unfortunately it does not work.

0

Please fix your configuration in the first place:

  • update the Kotlin Gradle plugin to 1.9.21
  • drop the `jvmTarget = "11"` — you're supposed to build the plugin for IDEs that rely on Java 17
  • the `intellij.sinceBuild` is lower than your target platform version. You may skip it as well.

If the issue remains, please provide the full stacktrace.

1

I works, now. Thanks a lot!

0

Please sign in to leave a comment.