hoc081098/ViewBindingDelegate

IllegalStateException Can't access the Fragment View's LifecycleOwner

nazirsalman opened this issue · 1 comments

In multiple fragments, we are facing the same issue.

Fatal Exception: java.lang.IllegalStateException: Can't access the Fragment View's LifecycleOwner for c0{7609394} (cc0421c4-bee5-4696-b899-4d95ab41c37b id=0x7f0a01d8) when getView() is null i.e., before onCreateView() or after onDestroyView()

we are declaring and initialising the binding as follows

private val binding by viewBinding(FragmentXBinding::bind)

Any hint or help would be highly appreciated

PS: we are using latest version 1.4.0

Hi @nazirsalman.
Could you share some lines of code to reproduce the issue easily?
IMO, you have accessed the binding before onCreateView() or after onDestroyView 🙏