Giorgi
07/07/2025, 12:52 PMGiorgi
07/07/2025, 12:52 PM16:51:14: Executing 'run -m jvm-app'…
/Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/amper run -m jvm-app
Logs are in file:///Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/build/logs/amper_2025-07-07_16-51-16_86163_run
00:02.801 INFO :ui:compileJvm Compiling module 'ui' for platform 'jvm'...
00:06.306 ERROR :ui:compileJvm e: file:///Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/ui/src/screens/stats/PlayerStatsScreen.kt:21:27 Unresolved reference 'compose'.
00:06.306 ERROR :ui:compileJvm e: file:///Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/ui/src/screens/stats/PlayerStatsScreen.kt:37:38 Unresolved reference 'collectAsStateWithLifecycle'.
00:06.304 WARN :ui:compileJvm w: Language version 2.2 is experimental, there are no backwards compatibility guarantees for new language and library features
ERROR: Task ':ui:compileJvm' failed: Kotlin compilation failed:
e: file:///Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/ui/src/screens/stats/PlayerStatsScreen.kt:21:27 Unresolved reference 'compose'.
e: file:///Users/Giorgi_Shalvashvili/IdeaProjects/Oversearch/ui/src/screens/stats/PlayerStatsScreen.kt:37:38 Unresolved reference 'collectAsStateWithLifecycle'.
16:51:21: Execution finished 'run -m jvm-app'.
Giorgi
07/07/2025, 12:52 PMGiorgi
07/07/2025, 12:54 PMimport androidx.lifecycle.compose.collectAsStateWithLifecycle
linerocketraman
07/07/2025, 1:57 PMcollectAsStateWithLifecycle
is Android only -- it doesn't exist on other platforms.Giorgi
07/07/2025, 1:58 PMGiorgi
07/07/2025, 1:58 PMzsmb
07/07/2025, 2:00 PMorg.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
rocketraman
07/07/2025, 2:03 PMzsmb
07/07/2025, 2:28 PMzsmb
07/07/2025, 2:29 PMzsmb
07/07/2025, 2:31 PMcollectAsStateWithLifecycle
would, it just relies on other, already multiplatform APIs (coroutines, Compose, core things from Lifecycle)rocketraman
07/07/2025, 2:33 PMcollectAsStateWithLifecycle
does have some platform-specific logic, because "lifecycle" varies on different platforms. The lifecycle docs I linked above give the non-Android platform specifics.rocketraman
07/07/2025, 2:34 PMLifecycleOwner
implementation though, and everything else is common.zsmb
07/07/2025, 2:35 PMLifecycle
implementation itself yes, would be different, I meant that the body of collectAsStateWithLifecycle
is likely identical from thereGiorgi
07/07/2025, 2:51 PMorg.jetbrains.androidx.lifecycle:lifecycle-runtime-compose
dependency fixed crash on JVMGiorgi
07/07/2025, 2:51 PMlouiscad
07/13/2025, 10:05 AMzsmb
07/14/2025, 7:01 AMui
package. That being said, we're currently fixing this in the KMP wizard, so that it does include this one by default.