You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
e: /...kt: (237, 17): Class 'com.squareup.kotlinpoet.FileSpec' was compiled with an incompatible version of Kotlin.
The binary version of its metadata is 1.9.0, expected version is 1.4.1.
Describe the solution you'd like
I suggest explicitly setting apiVersion and supporting several Kotlin releases.
For instance, if you could build with kotlinc 1.9.22, then set apiVersion=1.5 or 1.6.
At the same time, it would be great to see the compatibility matrix in the documentation somewhere.
Frankly speaking, I was not expecting that kotlinpoet 1.3.0 -> 1.15.3 would require upgrading apiVersion.
It makes sense to increase a major version when API target version changes.
Currently, it is hard to tell which kotlinpoet is usable if my Kotlin runtime is 1.8 (or 1.4)
It probably makes sense to add Xjdk-release=... kotlinc option as well to ensure the generated bytecode uses only the methods available in the target JDK release.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
Currently, kotlinpoet uses Kotlin 1.9 API target, so it is not usable in environments with older Kotlin version.
For instance, the current Gradle 8.5 targets Kotlin 1.8, so it makes it hard to use kotlinpoet in Gradle plugins.
See https://docs.gradle.org/current/userguide/compatibility.html
I get errors like
Describe the solution you'd like
I suggest explicitly setting
apiVersion
and supporting several Kotlin releases.For instance, if you could build with kotlinc 1.9.22, then set
apiVersion=1.5
or1.6
.At the same time, it would be great to see the compatibility matrix in the documentation somewhere.
Frankly speaking, I was not expecting that kotlinpoet 1.3.0 -> 1.15.3 would require upgrading
apiVersion
.It makes sense to increase a major version when API target version changes.
Currently, it is hard to tell which kotlinpoet is usable if my Kotlin runtime is 1.8 (or 1.4)
Additional context
See https://kotlinlang.org/docs/gradle-compiler-options.html#target-the-jvm
It probably makes sense to add
Xjdk-release=...
kotlinc option as well to ensure the generated bytecode uses only the methods available in the target JDK release.The text was updated successfully, but these errors were encountered: