https://kotlinlang.org logo
a

andylamax

06/13/2020, 2:34 PM
The KMP gradle plugin doesn't support jetpack compose. Any work around apart from using the id("kotlin-android")?
z

zalewski.se

06/13/2020, 3:14 PM
I don’t think there is any for now 😕 https://youtrack.jetbrains.com/issue/KT-38694
c

Chetan Sachdeva

06/13/2020, 3:46 PM
This project uses Jetpack compose and Swift UI https://github.com/joreilly/PeopleInSpace
z

zalewski.se

06/13/2020, 3:53 PM
@Chetan Sachdeva The problem is when you use compose in the KMP module. In the project you linked they use compose in a pure android app module
👌 1
c

Chetan Sachdeva

06/13/2020, 3:55 PM
Oh I see. Ideally, the UI code shouldn’t go in KMP module (
androidMain
). But if that’s whats intended, I’d recommend https://github.com/icerockdev/moko-widgets
1
j

JCollardBovy

06/13/2020, 4:18 PM
I wouldn't consider that being ideal, but rather a side effect of Compose still being in early development. The team behind has explained that currently compose depends on some custom changes being applied through AGP, but after removing or refactoring some dependencies this will change.
s

shikasd

06/13/2020, 7:13 PM
Compose uses a custom compiler version + plugin. You can force it for kmp module as well, but I suspect it will affect js compilation at least. AGP does something like this, so you can try to add it to your module to force compiler version.
a

andylamax

06/13/2020, 7:40 PM
@shikasd It indeed affected js compilation