Status Update
Comments
jb...@google.com <jb...@google.com> #2
We are also seeing this issue, affects users in production. Is there a workaround for this?
Other than downgrading to jetpack navigation 2.7 where we don't see this issue (as suggested by someone here:
lo...@outlook.com <lo...@outlook.com> #3
I can see the exact same issue, when turning off predictive navigation support in the app, instead of crashing, the component is launching from the wrong place.
When crashing, the stacktrace:
java.lang.IndexOutOfBoundsException: Index -1 out of bounds for length 1
at jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.util.Objects.checkIndex(Objects.java:359)
at java.util.ArrayList.get(ArrayList.java:434)
at androidx.navigation.compose.NavHostKt$NavHost$28$1.invokeSuspend(NavHost.kt:611)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:81)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run(AndroidUiDispatcher.android.kt:57)
at android.os.Handler.handleCallback(Handler.java:958)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loopOnce(Looper.java:230)
at android.os.Looper.loop(Looper.java:319)
at android.app.ActivityThread.main(ActivityThread.java:9063)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@af66c29, androidx.compose.runtime.BroadcastFrameClock@96bbae, StandaloneCoroutine{Cancelling}@3f11d4f, AndroidUiDispatcher@eb1bcdc]
After reverting to 2.7 the issue seems resolved, but this version doesn't support predictive back gestures, and the animation system is different too.
It sadly still isn't fixed in 2.9.0-alpha03.
an...@gmail.com <an...@gmail.com> #4
I seen this issues
if (inPredictiveBack) {
LaunchedEffect(progress) {
// This happens in the following line of code
val previousEntry = currentBackStack[currentBackStack.size - 2]
transitionState.seekTo(progress, previousEntry)
}
}
Here is this project:
I guess it's because I used this:
navController.navigate(
Router.QueuePage.route
) {
popUpTo(Router.MainView.route) {
// Inclusive means the start destination is also popped
inclusive = false
}
}
If I use this code, it will quickly come to this problem.
navController.navigate(Router.QueuePage.route) {
popUpTo(Router.QueuePage.route) {
inclusive = true
}
launchSingleTop = true
}
sh...@gmail.com <sh...@gmail.com> #5
I confirm the problem on Samsung S22 14 Android. Any news on its solution?
go...@gmail.com <go...@gmail.com> #6
I've had the same issues, except for me a slow duration isn't required, I've attached another sample project in case it's useful :)
go...@gmail.com <go...@gmail.com> #7
Worth noting that for me it doesn't just happen when navigating backwards, any navigation during a transition causes the old page to remain on screen ( video of it happening in the sample project I attached yesterday attached ).
fr...@cacd2.fr <fr...@cacd2.fr> #8
fr...@gmail.com <fr...@gmail.com> #9
da...@gmail.com <da...@gmail.com> #10
I got the same issue :
This is a full sample with the full code,
Just select an item and got back quickl and look at the logcat, onCleared of the viewmodel is not called.
th...@gmail.com <th...@gmail.com> #11
What was the problem? There doesn't seem to be any information in the release notes about how this was resolved. (Same problem occurs until 2.8.0-beta03)
There is a fix for an issue regarding the `Predictive back` function. Is this related to this?
Please confirm.
ti...@google.com <ti...@google.com> #12
Yes,
Marking this issue as a duplicate.
Description
If I navigate to a screen and quickly go back (before the navigation animation ends), the transition stops in a state where both screens are displayed at the same time and nothing moves. This happens with calls to
popBackStack()
and with the OS back gesture/button.I've included two videos to show the difference between a GOOD build (
2.8.0-alpha05
) and a BAD one (2.8.0-alpha06
). I've also attached the project used to record the videos.Steps to reproduce:
durationMillis = 6_000
)First screen
toSecond screen
, press/gesture back.I don't know if it helps, but I did a bisect of available builds from
androidx.dev
and the first build with the problem was11623948
(the previous build,11623861
, works fine).Thank you.