I have KMM app with `ViewModel`s inside shared mod...
# multiplatform
m
I have KMM app with `ViewModel`s inside shared module. am using Jetpack Compose on Android side, no Compose Multiplatform. since Compose can infer stability of the classes, interfaces etc. just from modules that are actually compiled with Compose compiler, will it help if I import Compose compiler in
shared
module or I just move my Android side Jetpack Compose code to
shared
module and go full Compose Multiplatform? my state classes are inside
shared
module and I can create 1:1 copy of those inside my Android module but I would rather do one of two I proposed
h
You could just apply the compose compiler for your shared module too, one drawback, it needs a compose runtime dependency. But I guess, this would be okay.
m
thank you
@hfhbd have you tried it before? am getting error
Copy code
Unable to find method ''void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)''
'void org.jetbrains.kotlin.gradle.dsl.KotlinJvmOptions.setUseIR(boolean)'
h
Yeah. Sounds like you have a problem with the Compose plugin and the used Kotlin version, which remove this setUseIR method in 1.7.0 (I think)
m
I see, thanks. I will try to experiment with versions etc.
h
What version do you use?
m
am using 1.7.10 but idk how it will work with 1.6.x version of kotlin in shared module and 1.7.10 in Android module
now that I typed it out it sounds like it should work, sometimes am frustrated with Gradle to the point where I delay to even try something 😄
h
I updated my public playground app: https://github.com/hfhbd/ComposeTodo/pull/618
m
thank you, I’ll try it
works, works like a charm. thank you I removed all hacks that I implemented to reduce UI junk and UI is smooth, Compose is inferring stability 🦜