https://kotlinlang.org logo
Title
d

darkmoon_uk

08/28/2021, 11:04 AM
How are devs with multiplatform Compose projects dealing with the current lack of
@Preview
. I'm a bit confused why there isn't more noise regarding it, because it means one of: a) nobody's using JB Compose to even notice (don't want to believe this one) or b) there's a workaround that I've missed or c) Devs are generally more patient than me and just quietly waiting until it works again ☺️?
j

Javier

08/28/2021, 11:10 AM
Preview is supported in desktop
d

darkmoon_uk

08/28/2021, 11:13 AM
@Javier thanks but that's not quite what I meant... Android preview doesn't work from the JB Compose (Multiplatform) artifact and hasn't done for several releases now. While there's a workaround for this, the workaround then prevents you from using Desktop preview. In summary, for Multiplatform development purposes, Preview is completely broken and I'm curious why we haven't been seeing more noise about that.
j

Javier

08/28/2021, 12:04 PM
I am using preview in both, desktop and android in multiplatform, the only problem I have is I can’t have preview composables in common so I have to have one in each source set, jvmMain and androidMain
d

darkmoon_uk

08/28/2021, 12:05 PM
Well that's really good news to me, if you confirm that's working, because I haven't been able to make it work.
j

Javier

08/28/2021, 12:05 PM
I think you only need to add the google preview dependencies for the android source set and the jetbrains one for the jvm source set
d

darkmoon_uk

08/28/2021, 12:06 PM
When I did that I got duplicate class definition errors.
I'll revisit it, now that you've said it can work.
Thanks 👍
The workaround in that thread
d

darkmoon_uk

08/28/2021, 12:09 PM
I know the
-beta09
workaround for Android; the issue was I couldn't configure both
-beta09
and Desktop simutaneously without getting Duplicate Class errors, even when configuring the only top-level projects and not a common module 🤔
I must have missed something... trying again.
j

Javier

08/28/2021, 12:18 PM
Not sure about beta09, I am using jetbrains alphas and google stables