Status Update
Comments
jb...@google.com <jb...@google.com> #2
I'm also seeing this crash, its the largest crash in my app by far. Thanks for reporting this
[Deleted User] <[Deleted User]> #3
I am on Samsung Galaxy Z Fold 5. Android 14. Very easy to reproduce when I unfold the phone and switch between navigation rail items very quickly. When the phone is folded the error cannot be reproduced (at least for me).
il...@google.com <il...@google.com>
jb...@google.com <jb...@google.com> #4
98% affected (unique) users are Samsung devices (2% motorola) - from 100 bug occurences over 10k+ users
100% are on Android 14
ap...@google.com <ap...@google.com> #5
In our case, to reproduce the crash, we press simultaneously the Action Bar back arrow (navController::navigateUp) AND the hardware back button.
This way we get the stacktrace:
java.lang.ArrayIndexOutOfBoundsException: length=10; index=-1
at java.util.ArrayList.get(ArrayList.java:439)
at androidx.navigation.compose.NavHostKt$NavHost$25$1.invokeSuspend(NavHost.kt:518)
- navigation-compose 2.8.3
- activity-compose 1.9.3
- Android 12 (API 31)
il...@google.com <il...@google.com> #6
as I understand it doesn't happen with androidxNavigation = "2.7.7"
version or lower, so let's not updated it until it's fixes
pr...@google.com <pr...@google.com> #7
as I understand it doesn't happen with androidxNavigation = "2.7.7" version or lower, so let's not updated it until it's fixes
Yes this is correct, unfortunately I'm past the point of no return because I migrated my app to type safe navigation APIs, it would be very unfortunate to migrate back because this crash is not resolved. Does anyone know why this issue has not been assigned to anyone? It seems like a huge, top voted, issue.
an...@daresay.co <an...@daresay.co> #8
li...@gmail.com <li...@gmail.com> #9
Project: platform/frameworks/support
Branch: androidx-main
Author: Jeremy Woods <
Link:
Add conditional check inside NavHost PredictiveBackHandler
Expand for full commit details
Add conditional check inside NavHost PredictiveBackHandler
There is no way to guarantee that we will get a composition if a state
change and back callback get triggered in the same frame. This can
result in triggering the `PredictiveBackHandler`'s callback even though
it should actually be disabled.
The cleaner options of fixing this are to change the
`PredictiveBackHandler`'s `enabled` parameter to a Boolean producing
lambda that can be executed internally and retrieve the current value,
but that needs a new API. (see 379152996#comment2)
In the meantime, we just need to add the same check inside of the
`PredictiveBackHandler`'s lambda.
RelNote: "Fixed an issue where `NavHost` could throw an exception
inside of the `PredictiveBackHandler` if the back stack is popped down
to 1 entry and a system back are triggered in the same frame."
Test: added testDisabledInSameFramePredictiveBack
Bug: 375343407
Change-Id: I1a4297a10f2d0da8c8477644b9250c61e4792923
Files:
- M
navigation/navigation-compose/src/androidTest/java/androidx/navigation/compose/NavHostPredictiveBackTest.kt
- M
navigation/navigation-compose/src/main/java/androidx/navigation/compose/NavHost.kt
Hash: f724837c72814a08c4177004ae3e8f380eea8367
Date: Fri Nov 15 20:56:54 2024
ho...@gmail.com <ho...@gmail.com> #10
ho...@gmail.com <ho...@gmail.com> #11
ho...@gmail.com <ho...@gmail.com> #12
Thank you so much for your hard work and persistence on this issue! Really excited for the 2.8.5 release :)
gi...@gmail.com <gi...@gmail.com> #13
by when can i expect 2.8.5 to hit stable and be available to use?
va...@zedge.net <va...@zedge.net> #14
by when can i expect 2.8.5 to hit stable and be available to use?
Based on the androidx release schedule, I'd assume it will be available December 11th. It looks like they skipped the thanksgiving release for most libraries and I'm hoping they'll be back with releases December 11th.
il...@google.com <il...@google.com> #15
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.navigation:navigation-compose:2.9.0-alpha04
androidx.navigation:navigation-compose:2.8.5
ja...@gopuff.com <ja...@gopuff.com> #16
I can confirm that our usual way of reproducing this issue with the debugger no longer crashes. Thanks a lot for this release!
Description
Versions
Component used: Navigation
Version used: 2.5.3
Devices/Android versions reproduced on: any
Description
According to the documentation of [BackHandler], nested BackHandlers(https://developer.android.com/reference/kotlin/androidx/activity/compose/package-summary#top-level-functions ) should take priority:
However, this doesn't work correctly if the activity is paused and then resumed.
Steps to reproduce
Code to demonstrate the issue
A sample project is attached.