Skip to content

Fatal Exception: java.lang.IllegalStateException #6

@glebkravchenko

Description

@glebkravchenko

Hi, on some devices when open BottomSheetDialogFragment app got crashed with this exception:

Fatal Exception: java.lang.IllegalStateException
Can't access the Fragment View's LifecycleOwner when getView() is null i.e., before onCreateView() or after onDestroyView()

Exception is pointing to viewbindig method:
DoWorkoutFragment.getFragmentBinding (DoWorkoutFragment.kt:50)
DoWorkoutFragment.access$getFragmentBinding (DoWorkoutFragment.kt:38)
DoWorkoutFragment$setupDoWorkoutScreen$1.invokeSuspend (DoWorkoutFragment.kt:79)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:106)

Which is inside of view binding delegate. What do I need to do to avoid this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions