Thread
#multiplatform
    s

    savrov

    2 years ago
    in continue of: https://kotlinlang.slack.com/archives/C3PQML5NU/p1589125830414200 I did the changes, so both modules are MPP now. I have to mention, that project structure is a bit more difficult, that just 2 models. I’m trying to combine Clean Architecture with MPP.  Priject structure is: • config (“pure-kotlin”) • domain (“pure-kotlin”) • data (“pure-kotlin”) • infrastructure (mpp module with android, jvm support) • utils (“pure-kotlin”) But as @Joffrey all these modules are MPP (with android and jvm support). And that’s a place where i got stuck. My
    :config
    has a dependency on
    :utils
    and buring build phase this dependency fails on
    Cannot choose between the following variants of project :utils:....
    I think that the reason is in defining targets in
    build.gradle
    files (every module have the same):
    jvm('backend') 
    jvm('android')
    So compiler does not know what to do. Neither me. =( If you have some thoughts or ideas how to solve this, please share, thank you
    Ugi

    Ugi

    2 years ago
    If I understood correctly, and your library is pure kotlin, then you shouldn't need to have two jvm targets, as you can just use the default one on android.
    so just
    jvm('backend')
    And then in your
    infrastructure
    project, where you want to use android specific stuff, you would use something like:
    jvm()
    android()
    s

    savrov

    2 years ago
    yeah, it works! Thank you