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

Fix no view found for id when using API 24. #165

Open
wants to merge 2 commits into
base: fondazione
Choose a base branch
from

Conversation

OKatrych
Copy link

@OKatrych OKatrych commented Oct 5, 2021

On API 24 devices FragmentStateManager crashes with exception:

Fatal Exception: java.lang.IllegalArgumentException
No view found for id 0xb8610aaa (unknown) for fragment SomeFragment

Steps to reproduce:

  1. Run the app
  2. Try to close it and open fast and frequently

Solution:
Use ViewCompat.generateViewId() which is designed to generate view
id.

A weird thing is that this crash is not occurring on the latest Android
versions (e.g. API 30), probably API 24 has some specific view id
requirements.

Oleksandr Katrych and others added 2 commits October 5, 2021 19:33
On API 24 devices `FragmentStateManager` crashes with exception:
```
Fatal Exception: java.lang.IllegalArgumentException
No view found for id 0xb8610aaa (unknown) for fragment SomeFragment
```

Steps to reproduce:
1. Run the app
2. Try to close it and open fast and frequently

Solution:
Use `ViewCompat.generateViewId()` which is designed to generate view
id.

My comment:
Weird thing that this crash is not occurring on latest Android
versions (e.g. API 30), probably API 24 has some specific view id
requirements.
Fix no view found for id when using API 24.
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

Successfully merging this pull request may close these issues.

None yet

1 participant