https://kotlinlang.org logo
Title
r

Raphael TEYSSANDIER

05/15/2023, 11:05 PM
I keep having
Module with the Main dispatcher is missing. Add dependency providing the Main dispatcher, e.g. 'kotlinx-coroutines-android' and ensure it has the same version as 'kotlinx-coroutines-core'
on a
jvm
target
e

ephemient

05/15/2023, 11:09 PM
Dispatchers.Main
only works if there is an event loop
if you're not in either one of those, you'll have to provide your own
r

Raphael TEYSSANDIER

05/15/2023, 11:11 PM
I use
compose-multiplatform
So that means I need to create one ?
Nevermind, swing is working. Thank’s !
e

ephemient

05/15/2023, 11:17 PM
technically it does use Swing for windowing, so the Swing dispatcher works. but what do you need
Main
for in a Compose app?
while Compose as currently implemented runs compositions on the UI thread, conceptually it doesn't need one and may be be multithreaded in the future. MutableState et al. are thread-safe.
r

Raphael TEYSSANDIER

05/15/2023, 11:26 PM
A separate module need Main. But it was for
iOS
since it wasn’t supporting background threading. But I should remove that now. Thank’s for pointing it out