question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

force close app after upgrade to 2.43 [Jetapack Compose]

See original GitHub issue
java.lang.IllegalArgumentException: CreationExtras must have a value by `SAVED_STATE_REGISTRY_OWNER_KEY`
        at androidx.lifecycle.SavedStateHandleSupport.createSavedStateHandle(SavedStateHandleSupport.kt:91)
        at androidx.lifecycle.AbstractSavedStateViewModelFactory.create(AbstractSavedStateViewModelFactory.java:89)
        at dagger.hilt.android.internal.lifecycle.HiltViewModelFactory.create(HiltViewModelFactory.java:111)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:187)
        at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.kt:153)
        at androidx.lifecycle.viewmodel.compose.ViewModelKt.get(ViewModel.kt:215)
        at androidx.lifecycle.viewmodel.compose.ViewModelKt.get$default(ViewModel.kt:195)
        at androidx.lifecycle.viewmodel.compose.ViewModelKt.viewModel(ViewModel.kt:120)
.....

dependencies:

implementation 'androidx.lifecycle:lifecycle-viewmodel-compose:2.5.0'
implementation 'androidx.hilt:hilt-navigation-compose:1.0.0'
implementation 'androidx.activity:activity-compose:1.5.0'

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:10 (1 by maintainers)

github_iconTop GitHub Comments

23reactions
iwocommented, Aug 9, 2022

I had the same issue and resolved it by adding implementation("androidx.fragment:fragment-ktx:1.5.1") dependency. Fragment.viewModels() is defined in this library and previously it was only transitive dependency resolved to the older version.

6reactions
dshokouhicommented, Aug 5, 2022

We had also experienced this error in the Home Assistant app. We already had the navigation-compose dependency mentioned. We needed to add androidx.fragment dependency and the crash went away. Just commenting here for the next person who may get stuck 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

Jetpack Compose: close application by button - Stack Overflow
NavController can't pop programmatically the latest @Composable in the stack. I.e. popBackStack() doesn't work if it's a root page. So the ...
Read more >
Android Jetpack Compose - Close Application By Button
In this article, we will take a look at How to quit an android application programmatically using Jetpack Compose.
Read more >
Clean Android multi-module offline-first scalable app in 2022
The main intention was to show good practices using Kotlin features and latest Android libraries from Jetpack in the simplest possible way, ...
Read more >
Side-effects in Compose - Android Developers
A side-effect is a change to the state of the app that happens outside the scope of a composable function.
Read more >
Let's Build a Stopwatch Application with Jetpack Compose!
Let's Build a Stopwatch Application with Jetpack Compose ! ... Be sure to watch the hole video, since there are lots of important...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found