Migrating to the new <Android-KMP> plugin caused o...
# multiplatform
c
Migrating to the new Android-KMP plugin caused our previews in commonMain to be broken. I've come across an issue for this already on the issue tracker (https://issuetracker.google.com/issues/422373442), without a solution yet. But maybe anyone here does know a temporary workaround?
t
Workaround is proposed in this comment in the issue
c
That doesn't work when having iOS targets
m
I fail to see why it doesn’t work with iOS targets as far those missing dependencies are properly defined. Do you have just iOS target or both ? and what exception you are getting ?
Feel free to add those details on the ticket so its more easy to track
c
I might be doing something wrong ofcourse. But using the project from the example (
new-KMP plugin preview ClassNotFoundException.zip
). And adding the workaround, gradle sync is successful. Adding to the kotlin block:
Copy code
iosArm64()
iosX64()
iosSimulatorArm64()
gradle fails to sync with:
:composeApp:iosArm64Main: Could not resolve androidx.compose.ui:ui-tooling:1.8.2.
, same for the other iOS targets
e
What if you use
androidMain
for the dependencies mentioned in the workaround instead of
commonMain
m
Thank you for sharing this, seems gradle sync is marked as failed but build actually succeeded and despite that compose previous are working fine. For sure this needs to be properly addressed but unfortunately there’s no workaround for this
He is interested on using compose preview for
commonMain
in that case those dependencies needs to be added there
c
Alright, thank you for looking into it 👍