AniTrend/anitrend-v2

[android-navigation] Bottom drawer definition crash on resume after system initiated process death

wax911 opened this issue · 0 comments

AniTrend Issue Guidelines

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

You may find an answer in already closed issues:
https://github.com/AniTrend/anitrend-v2/issues?q=is%3Aissue+is%3Aclosed

Description of Bug

Leaving the application in background for a long time, in my case a few hours occasionally triggers a crash. This might vary from device to device based on available system memory and vendor power saving configuration. It seems like a view model creation issue happens post resuming the application from process death, hinting towards a failure to recreate saveInstanceBundle

Reproduction Steps

  • Open anitrend and make sure you're on the main screen as seen in the screenshot below
  • Simulate process death

Simulating process death was able to reproduce the crash sometimes

Screenshots/Videos

Device & Build Information

Not device dependent, affects all the current alpha versions

  • OS Version: 10
  • App Version: 2.0.0-alpha40
  • Phone Model: POCO F1
  • Phone Brand: Xiaomi

Donwload Source:

  • Playstore
  • Github
  • Other (built from source)

Additional Context

Further investigations are still required to assure that we can reproduce this reliably

2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:549)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler: Caused by: java.lang.reflect.InvocationTargetException
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at java.lang.reflect.Method.invoke(Native Method)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler: 	... 1 more
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler: Caused by: org.koin.core.error.InstanceCreationException: Could not create instance for [Factory:'co.anitrend.navigation.drawer.component.viewmodel.BottomDrawerViewModel']
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:60)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.instance.FactoryInstanceFactory.get(FactoryInstanceFactory.kt:38)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.registry.InstanceRegistry.resolveInstance$koin_core(InstanceRegistry.kt:110)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveValue(Scope.kt:254)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveInstance(Scope.kt:241)
2022-07-23 09:42:15.993 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.get(Scope.kt:204)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.getOrNull(Scope.kt:172)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.findInOtherScope(Scope.kt:289)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveValue(Scope.kt:269)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveInstance(Scope.kt:241)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.get(Scope.kt:204)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.lifecycle.StateViewModelFactory.create(StateViewModelFactory.kt:17)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.lifecycle.AbstractSavedStateViewModelFactory.create(AbstractSavedStateViewModelFactory.java:69)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:185)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.lifecycle.ViewModelProvider.get(ViewModelProvider.java:150)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.androidx.viewmodel.ViewModelResolverKt.resolveInstance(ViewModelResolver.kt:15)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(ScopeExt.kt:67)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.androidx.viewmodel.scope.ScopeExtKt.getViewModel(ScopeExt.kt:53)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.androidx.viewmodel.ext.android.SavedStateRegistryOwnerExtKt.getStateViewModel(SavedStateRegistryOwnerExt.kt:73)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.component.content.BottomDrawerContent$special$$inlined$stateViewModel$default$1.invoke(SavedStateRegistryOwnerExt.kt:75)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.component.content.BottomDrawerContent$special$$inlined$stateViewModel$default$1.invoke(SavedStateRegistryOwnerExt.kt:42)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at kotlin.UnsafeLazyImpl.getValue(Lazy.kt:81)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.component.content.BottomDrawerContent.getViewModel(BottomDrawerContent.kt:71)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.component.content.BottomDrawerContent.setUpViewModelObserver(BottomDrawerContent.kt:247)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.arch.ui.fragment.SupportFragment.onViewCreated(SupportFragment.kt:125)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.component.content.BottomDrawerContent.onViewCreated(BottomDrawerContent.kt:260)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.Fragment.performViewCreated(Fragment.java:3019)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:551)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:261)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:113)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1374)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:2841)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:2784)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:262)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:478)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1433)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.Activity.performStart(Activity.java:7923)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3332)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2044)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.os.Handler.dispatchMessage(Handler.java:107)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.os.Looper.loop(Looper.java:224)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at android.app.ActivityThread.main(ActivityThread.java:7562)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler: 	... 3 more
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler: Caused by: org.koin.core.error.NoBeanDefFoundException: |- No definition found for class:'androidx.lifecycle.SavedStateHandle'. Check your definitions!
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.throwDefinitionNotFound(Scope.kt:304)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveValue(Scope.kt:274)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.resolveInstance(Scope.kt:241)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.scope.Scope.get(Scope.kt:204)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.koin.ModulesKt$viewModelModule$1$1.invoke(Modules.kt:113)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at co.anitrend.navigation.drawer.koin.ModulesKt$viewModelModule$1$1.invoke(Modules.kt:52)
2022-07-23 09:42:15.994 14957-14957/co.anitrend E/ExceptionCrashHandler:     at org.koin.core.instance.InstanceFactory.create(InstanceFactory.kt:53)