Doing KMM with Compose on Android. Android Studio doesn't handle multiplatform well -- tests in shar...
r
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
My guess is that this tooling issue will be resolved later this year. KMM is still in alpha!
r
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
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
@Colton Idle nice, thank you for the reference.
a
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
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.