andylamax

    andylamax

    2 years ago
    The KMP gradle plugin doesn't support jetpack compose. Any work around apart from using the id("kotlin-android")?
    zalewski.se

    zalewski.se

    2 years ago
    I don’t think there is any for now 😕 https://youtrack.jetbrains.com/issue/KT-38694
    Chetan Sachdeva

    Chetan Sachdeva

    2 years ago
    This project uses Jetpack compose and Swift UI https://github.com/joreilly/PeopleInSpace
    zalewski.se

    zalewski.se

    2 years ago
    @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
    Chetan Sachdeva

    Chetan Sachdeva

    2 years ago
    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
    j

    JCollardBovy

    2 years ago
    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.
    shikasd

    shikasd

    2 years ago
    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.
    andylamax

    andylamax

    2 years ago
    @shikasd It indeed affected js compilation