https://kotlinlang.org logo
Title
h

hfhbd

02/12/2023, 9:32 AM
There is no androidx 1.4.2 compiler version with 1.8.10 support rebased by JetBrains, is it?
j

Javier

02/12/2023, 9:46 AM
h

hfhbd

02/12/2023, 9:49 AM
Yeah, I mean dev builds too.
h

hfhbd

02/12/2023, 11:18 AM
Overwriting the compose version and using the androidx version is possible, but some fixes are not upstreamed so I have to use compose-jb or wait for upstream changes: https://github.com/JetBrains/compose-jb/issues/2635
j

jw

02/12/2023, 8:22 PM
1.8.10 should be compatible so you can suppress the version check
h

hfhbd

02/12/2023, 9:16 PM
Thanks, suppressing the check does work for jvm/android targets, but I still get the incompatible version error when assembling a js/ios target.
compose {
    kotlinCompilerPlugin.set(dependencies.compiler.forKotlin("1.8.0"))
    kotlinCompilerPluginArgs.add("suppressKotlinVersionCompatibilityCheck=1.8.10")
}
Do you get the same results with js/ios targets?
j

jw

02/13/2023, 12:41 AM
i haven't done it in a while, and i don't use the DSL
in the past i've always done it by adding to freeCompilerArgs
h

hfhbd

02/13/2023, 7:05 AM
Hm, the compose dsl is basically a wrapper adding the freecompilerargs and it does work for some targets. Very strange.
Okay, setting the freecompilerargs manually did work.
tasks.withType(KotlinCompile::class).configureEach {
  kotlinOptions { 
    freeCompilerArgs = freeCompilerArgs + listOf(
      "-P", "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=1.8.10"
    )
  }
}
https://github.com/JetBrains/compose-jb/issues/2734