> Kotlin 1.4.31 is now available with fixes for...
# compose
c
Kotlin 1.4.31 is now available with fixes for several bugs, including some that appeared in IntelliJ IDEA and Android Studio with Kotlin 1.4.30.
Safe to update, or will that blow something up with compose? https://twitter.com/kotlin/status/1365237672231452675
j
Should be safe to update, but you would need to suppress the version check. Or you could just wait for us to update with a new version of Compose.
c
Ooh. I didn't know you could surppress the version check. Let me check slack if that's been described already.
@jim alright. So I basically don't have to ask this question every time a new version comes out. Looks like compose has a built in check for the version of kotlin that should be used. So the answer will always have to be that a kotlin version is published, and then the next follow up compose release will "target" that version (most likely). Is that about right?
j
Correct.
c
Also, if anyone is interested I got around the issue by adding this snippet to the bottom of my app level build.gradle
Copy code
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
    kotlinOptions {
        jvmTarget = "1.8"
        freeCompilerArgs += [
                "-Xallow-jvm-ir-dependencies",
                "-P",
                "plugin:androidx.compose.compiler.plugins.kotlin:suppressKotlinVersionCompatibilityCheck=true"
        ]
    }
}
j
Just keep in mind suppressing is dangerous, the check exists for a reason. If you run an incompatible version of Compose, who knows what might happen 😉
c
Understood. I guess I just sort of assumed that it would always be forward compatible. I have never actually hit the error message from compose because I never adopted a kotlin version faster than compose (I have only tried a handful of compose versions). So good to just know that. Thank you Jim!
t
Sorry, I am unclear how the Kotlin update relates to the AS Canary plugin. That is, do we need to wait for the 1.4.31 AS plugin before we update the Kotlin compiler to 1.4.31?
c
I'm not 100% either but I think the plugin affects the actual IDE and the kotlin version definition in your project affects compilation of the project. Typically my team updates the project, and then everyones local machine plugin.
t
So do you wait to update the plugins before updating the project compiler version?
j
I think usually the version in the IDE and the version in Gradle are relatively independent, although there are some places the IDE will try to make accommodations to better match the semantics defined in your gradle file. But I would find it surprising if a version change in your gradle file measurably impacted IDE performance.
t
Thank you for the input. I went ahead and updated gradle files to call out 1.4.31 and added the compose version check override, and everything appears to be working as expected (fine, that is).