Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IllegalStateException Can't access the Fragment View's LifecycleOwner #180

Open
nazirsalman opened this issue Feb 14, 2024 · 1 comment
Open
Assignees

Comments

@nazirsalman
Copy link

nazirsalman commented Feb 14, 2024

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

@hoc081098
Copy link
Owner

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 🙏

@hoc081098 hoc081098 self-assigned this Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants