Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 7c72f26cb68d683974688de3291f2d09a18ee7d8
Author: Clara Fok <clarafok@google.com>
Date: Wed May 22 12:41:35 2024
Fix decoding for nullable custom types
Fixed by skipping recursive deserialization into nullable custom types, and instead directly retrieve the value from bundle.
Test: ./gradlew navigation:navigation-common:cC
Bug: 342239473
Relnote: "Fixed ClassCastException crash when using NavBackStackEntry.toRoute with nullable custom NavTypes."
Change-Id: I1c29be47a230c2c991aa24924c57b6a3f97ecd5d
M navigation/navigation-common/src/androidTest/java/androidx/navigation/serialization/RouteDecoderTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/RouteDecoder.kt
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/RouteDeserializer.kt
https://android-review.googlesource.com/3098137
Branch: androidx-main
commit 7c72f26cb68d683974688de3291f2d09a18ee7d8
Author: Clara Fok <clarafok@google.com>
Date: Wed May 22 12:41:35 2024
Fix decoding for nullable custom types
Fixed by skipping recursive deserialization into nullable custom types, and instead directly retrieve the value from bundle.
Test: ./gradlew navigation:navigation-common:cC
Bug: 342239473
Relnote: "Fixed ClassCastException crash when using NavBackStackEntry.toRoute with nullable custom NavTypes."
Change-Id: I1c29be47a230c2c991aa24924c57b6a3f97ecd5d
M navigation/navigation-common/src/androidTest/java/androidx/navigation/serialization/RouteDecoderTest.kt
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/RouteDecoder.kt
M navigation/navigation-common/src/main/java/androidx/navigation/serialization/RouteDeserializer.kt
cl...@google.com <cl...@google.com> #3
Fixed internally and will be available in navigation 2.8.0-beta02
.
ga...@gmail.com <ga...@gmail.com> #4
Thanks #3! Can we have an ETA?
cl...@google.com <cl...@google.com> #5
Currently scheduled for release on May 29th.
na...@google.com <na...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-common:2.8.0-beta02
Description
Reproducible on calling NavBackStackEntry.toRoute().
Example:
NavType for nullable:
NavHost code:
The following works (no error):
The following will cause a "ClassCastException: IndividualId cannot be cast to java.lang.String"