I'm trying to implement navigation in my app which is built with Jetpack Compose, but when I try to navigate from a screen to another I get:
java.lang.IllegalArgumentException: CreationExtras must have a value by
SAVED_STATE_REGISTRY_OWNER_KEY
I'm using:
implementation "androidx.hilt:hilt-navigation-compose:1.0.0"
And here is the code:
if(viewModel.isAuthenticated) {
navController.navigate(Screen.Profile.route)
}
Hilt release notes for 2.43 flags a dependency incompatibility:
As part ViewModel bug fixes, dependencies were updated as below. androidx.navigation users will need to update to 2.5.0 to interoperate. These libraries require building with SDK 31. To build with SDK 31, AGP users will need to use AGP 7.0+. This will also require using JDK11.
- androidx.activity and androidx.fragment to 1.5.0
- androidx.lifecycle to 2.5.0
- androidx.savedstate to 1.2.0