s3rius
03/31/2023, 1:25 PMcommonMain
I use implementation(compose.uiTooling)
.
In 1.4.0-alpha1000
, I see the following dependency tree for my desktop variant:
+--- org.jetbrains.compose.ui:ui-tooling:1.4.0-alpha01-dev1000
| \--- org.jetbrains.compose.ui:ui-tooling-desktop:1.4.0-alpha01-dev1000
| +--- org.jetbrains.compose.ui:ui-tooling-data:1.4.0-alpha01-dev1000
| | \--- org.jetbrains.compose.ui:ui-tooling-data-desktop:1.4.0-alpha01-dev1000
| | +--- androidx.compose.runtime:runtime:1.2.1
| | | \--- org.jetbrains.kotlinx:kotlinx-coroutines-android:1.6.1 -> 1.6.4
Note the coroutines-android at the end. It seems this causes Android's MainDispatcherFactory
to be present in the source, which takes precendence over Swings MainDispatcherFactory
. As a result, my desktop app tries to load Androids Main Dispatcher and crashes.
In 1.4.0-alpha977
this dependency doesn't exist:
+--- org.jetbrains.compose.ui:ui-tooling:1.4.0-alpha01-dev977
| \--- org.jetbrains.compose.ui:ui-tooling-desktop:1.4.0-alpha01-dev977
| +--- org.jetbrains.compose.ui:ui-tooling-data:1.4.0-alpha01-dev977
| | \--- org.jetbrains.compose.ui:ui-tooling-data-desktop:1.4.0-alpha01-dev977
| | +--- org.jetbrains.compose.runtime:runtime:1.4.0-alpha01-dev977 (*)
Now, given that uiTooling
has an explicit desktop
variant it should probably be fine to use it in non-Android environments. So I'm guessing this has been a bug introduced by the recent merge of Google's Compose 1.4.0 where uiTooling doesn't depend on the correct runtime anymore?Igor Demin
03/31/2023, 1:48 PMs3rius
03/31/2023, 2:03 PM