Sometime ago I published a library with Amper and ...
# amper
g
Sometime ago I published a library with Amper and used.
Copy code
settings:
  kotlin:
    languageVersion: 2.2
now when I try to consume it from a Gradle project, the build fails
this is the error
Copy code
e: file:///Users/Giorgi_Shalvashvili/Downloads/aaaaaaaaa/data/src/commonMain/kotlin/OverwatchPlayerSearchDataSource.kt:9:32 Class 'io.github.shalva97.overwatch_player_search_api.PlayerSearch' was compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler.
so what version of Kotlin should I use in Gradle project?
currently I have
kotlin = "2.2.20-Beta1"
j
Amper wasn't released with the 2.2 compiler yet, so you were most likely using Kotlin 2.1.20 (which is the compiler used since Amper 0.6.0). The
languageVersion
set in the settings is a compiler option but doesn't change the actual Kotlin tool chain. When using a higher version than the compiler, it makes the compiler accept new experimental language constructs of future versions. This is probably why you're seeing this.
You could maybe try using Kotlin 2.1.20 with the same language level setting on the consumer side.