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

Crash due to Parcelable encountered IOException writing serializable #340

Closed
YoussefHachicha opened this issue Feb 21, 2024 · 6 comments
Closed

Comments

@YoussefHachicha
Copy link

Screenshot 2024-02-21 at 8 26 32 AM
when i pass to my Screen this
if i leave the app in the backGround it will crash with this message:
Parcelable encountered IOException writing serializable object (name = quran.navigation.quran.QuranScreenNav)

@enoler
Copy link

enoler commented Feb 21, 2024

Same problem here, it happens if for example I open via Intent a link in a browser.

@shpasha
Copy link
Contributor

shpasha commented Feb 21, 2024

Suppose, that ScreenSize is not serializable model. Try to obtain it through composition local providers

@DevSrSouza
Copy link
Collaborator

DevSrSouza commented Feb 22, 2024

Voyager Screens parameters should act like a State that can the Save with the Saver Compose API.

By default all Voyager Screen are Java Serializable, but you can override it by using for exemple Parcelable if you want.

@shpasha recommendation is the best for solving your issue

@N-Pu
Copy link

N-Pu commented Feb 24, 2024

I have the same problem and don't really understand how to solve it.

@N-Pu
Copy link

N-Pu commented Feb 24, 2024

Voyager Screens parameters should act like a State that can the Save with the Saver Compose API.

By default all Voyager Screen are Java Serializable, but you can override it by using for exemple Parcelable if you want.

@shpasha recommendation is the best for solving your issue

Sorry, could you have a code example for this one? That would be very helpful.

@YoussefHachicha
Copy link
Author

I solved the problem, its due to passing a Navigator Instance from a Screen to. a Screen instead i used the
val navigator = LocalNavigator.currentOrThrow.parent

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

5 participants