-
-
Notifications
You must be signed in to change notification settings - Fork 137
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 when using Parcelable class as navigation argument #653
Comments
Hi 👋 This is definitively not an issue general to parcelable nav arguments given that I have plenty of working examples with them. Can you share more about how the class looks like and how you are navigating? |
Also, add the crash stacktrace if possible 🙏 |
Hey, thanks for the fast reply! Alright, thanks for the info. That's good to know. Ye I tried it with multiple different classes but I can surely share an example.
That's my target composable
That's my navigate call
|
Ye, sure:
|
I was able to reproduce it, still looking into it. One thing that could be an ok workaround is to navigate to the start destination directly rather than to the nav graph. |
Fixed, this was a change that happened on the official library which I didn't know about and it changed a behaviour here where it could call parseValue with the default value (like Next release this will be fixed, but please let me know either way how it goes! 🙏 |
I'm experiencing a crash when using the Android
Parcelable
class as a navigation argument in the library. It seems that the generated NavType class code has a bug. Specifically, the functionparseValue
is called twice: once with the correct value and once with the key as the value, which leads to the crash.Im using the version: 2.1.0-beta09
Steps to Reproduce:
Expected Behavior:
The navigation should succeed without any crashes, with the
parseValue
function being called correctly with the intended value.Actual Behavior:
The
parseValue
function is called twice:The text was updated successfully, but these errors were encountered: