After upgrading `androidx.hilt:hilt-navigation-com...
# compose-wear
a
After upgrading
androidx.hilt:hilt-navigation-compose
to
1.0.0-beta01
I am now getting this error:
You cannot access the NavBackStackEntry's ViewModels until it is added to the NavController's back stack (i.e., the Lifecycle of the NavBackStackEntry reaches the CREATED state).
But I commented out all of my ViewModel stuff and it's still erroring out. Can anyone explain what changed? This is basically all I have:
Copy code
SwipeDismissableNavHost(
    navController = navController,
    startDestination = "start",
    modifier = Modifier.background(MaterialTheme.colors.background)
) {

    composable("start") {
//                val mainViewModel = hiltViewModel<MainViewModel>()
//                val uiState = mainViewModel.uiState.collectAsState()

        Box(
            modifier = Modifier.fillMaxSize(),
            contentAlignment = Alignment.Center
        ) {
            Text("uiState.value")
        }
    }
}
👍 1
i
That sounds like this issue, which is already fixed for the next release: https://issuetracker.google.com/issues/207328687
👍 2
👍🏽 1
👍🏻 1
a
Thanks! Didn't see that