My IntelliJ IDEA plugin based on official Kotlin template. I had no Kotlin experience until tried to develop the plugin for IntelliJ IDEA.
I got the error:
C:/Users/I/.gradle/caches/modules-2/files-2.1/com.jetbrains.intellij.idea/ideaIC/2022.2/42c296374014a649785bb84aa6d8dc2d18f2ca0e/ideaIC-2022.2/lib/3rd-party-rt.jar!/META-INF/kotlinx-datetime.kotlin_module:
Module was compiled with an incompatible version of Kotlin. The binary version of its metadata is 1.7.1, expected version is 1.5.1.
when updated some options in gradle.properties:
pluginGroup = com.yamatodaiwa
pluginName = Yamato-Daiwa Frontend
pluginVersion = 0.0.3
pluginSinceBuild = 221
pluginUntilBuild = 222.*
pluginVerifierIdeVersions = 2022.1, 2022.2
platformType = IC
platformVersion = 2022.2
platformDownloadSources = true
javaVersion = 11
gradleVersion = 7.2
kotlin.stdlib.default.dependency = false
I checked the similar topics, but the solutions like
ext.kotlin_version = '1.6.10'
are not actual for the projects with build.gradle.kts (not build.gradle) - there is no ext.kotlin_version option:
import org.jetbrains.changelog.markdownToHTML
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
fun properties(key: String) = project.findProperty(key).toString()
plugins {
// Java support
id("java")
// Kotlin support
id("org.jetbrains.kotlin.jvm") version "1.5.30"
// Gradle IntelliJ Plugin
id("org.jetbrains.intellij") version "1.1.6"
// Gradle Changelog Plugin
id("org.jetbrains.changelog") version "1.3.0"
// Gradle Qodana Plugin
id("org.jetbrains.qodana") version "0.1.12"
}
group = properties("pluginGroup")
version = properties("pluginVersion")
...