https://kotlinlang.org logo
#multiplatform
Title
# multiplatform
r

rocketraman

04/16/2021, 2:25 PM
Doing KMM with Compose on Android. Android Studio doesn't handle multiplatform well -- tests in shared code don't run properly, or resolve references. But IDEA Ultimate doesn't have a version of the Android Studio plugin needed for Compose. Anyone else having this issue and managed to work around it somehow?
l

louiscad

04/16/2021, 7:09 PM
My guess is that this tooling issue will be resolved later this year. KMM is still in alpha!
r

rocketraman

04/16/2021, 10:44 PM
Yup, wouldn't be any fun if we weren't using alpha-level stuff! FWIW, I was able to get Compose working with an older version of the android gradle plugin, which means I can use IJ IDEA again instead of Studio, using this sample project/commit as a guide: https://github.com/joreilly/MortyComposeKMM/commit/3d73c0d64f58fdae719ad66ee75830f1e245b608. Which mostly works, except now I had to manually mark the
src/kotlin
folders of my shared module as source folders, which I didn't have to do before... but after doing that, things are finally working.
😯 1
Not marking folders as sources is due to https://github.com/mockk/mockk/issues/513.
c

Colton Idle

04/17/2021, 2:34 AM
Yeah. I'm personally not happy that KMM doesn't work all that well with latest compose and latest agp, gradle etc. But it's all still bleeding edge... hopefully soon it'll work. John OReilly followed this guide btw: https://marcellogalhardo.dev/posts/2021/03/30/using-compose-beta-on-as-4-1/
👍 1
r

rocketraman

04/17/2021, 12:10 PM
@Colton Idle nice, thank you for the reference.
a

Arkadii Ivanov

04/18/2021, 12:24 AM
I'm using Compose and Multiplatform in Android Studio Beta currently without any issues, well except the Preview feature does not work. Gradle 6.7.1. All unit tests are working.
r

rocketraman

04/18/2021, 1:00 AM
I think the problem was that mockk-related issue all along. However I'm happier in intellij idea as opposed to studio anyway.
BTW the latest canary seemed to require Grade 7.
3 Views