galex
10/21/2025, 4:39 PMnav3 in a Compose Multiplatform project, did anyone manage to use the new org.jetbrains.androidx.lifecycle:lifecycle-viewmodel-navigation3 artifact so that we can use rememberViewModelStoreNavEntryDecorator() to scope a ViewModel to the composable in the backstack?
I tried many versions, latest I tried is
compose-multiplatform = "1.10.0-alpha03+dev3110"
navigation3-runtime = "1.0.0+dev2861"
navigation3-ui = "1.0.0-alpha03+dev3110"
navigation3-viewmodel = "2.10.0-alpha03+dev3110"
Basically, the IDE lets me import the library, but when building I get errors like the library is not even present:
> Task :features:categories:compileDebugKotlinAndroid
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:6:37 Unresolved reference 'EntryProviderBuilder'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:8:37 Unresolved reference 'entry'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:28:5 Unresolved reference 'EntryProviderBuilder'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:32:5 Unresolved reference 'entry'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:32:29 Cannot infer type for value parameter 'chooseCategory'. Specify it explicitly.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:34:50 @Composable invocations can only happen from the context of a @Composable function
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:35:42 @Composable invocations can only happen from the context of a @Composable function
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:37:9 @Composable invocations can only happen from the context of a @Composable function
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:45:5 Unresolved reference 'entry'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:45:32 Cannot infer type for value parameter 'chooseSubCategory'. Specify it explicitly.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:47:53 @Composable invocations can only happen from the context of a @Composable function
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:47:100 Unresolved reference 'categoryType'.
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:48:42 @Composable invocations can only happen from the context of a @Composable function
e: (...)/features/categories/navigation/CategoriesNavEntries.kt:50:9 @Composable invocations can only happen from the context of a @Composable function
What am I missing? 🤔zsmb
10/21/2025, 5:00 PMEntryProviderBuilder with EntryProviderScope, it was renamed in newer versions. I assume the other errors are fixed by this change from here.
I have a working usage of the new library in this commit/PR, though the code overall is still draft quality (so don't take it as an exact sample necessarily)
https://github.com/JetBrains/kotlinconf-app/pull/504/commits/50557adc4bcae06357fcb7254d8a1d1e956d4eecgalex
10/21/2025, 5:41 PMzsmb
10/21/2025, 9:11 PM