I have a module wich is used in the main phone app and in a wear os app.
The module uses compose, so I added compose as dependencies:
implementation(platform(libs.compose.bom)) // 2023.08.00
implementation(libs.compose.ui)
implementation(libs.compose.animation)
implementation(libs.compose.foundation)
When I now run the phone app, it crashes with
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/runtime/PrimitiveSnapshotStateKt;
(
mutableFloatStateOf
) but runtime dependency is added 🤔
The wear app builds fine.
I found out, that the phone app runs fine if I add e.g. the accompanist pager as dependency - which makes no sense for me…
But then the wear app crashes at runtime with
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/compose/runtime/PrimitiveSnapshotStateKt;
(
mutableFloatStateOf
) (so exact same reason as the phone app before)
Does anyone have an idea why this happens and how I can fix this?