Status Update
Comments
co...@gmail.com <co...@gmail.com> #2
Then i updated to One UI 6.0, and now i can consistently reproduce the IndexOutOfBoundsException.
so...@google.com <so...@google.com> #3
Not limited to Samsung tho, we also have OnePlus and Sony users affected.
EDIT: I'm using version 2.9.0-alpha04 of the navigation library. But this crash goes way back.
The stacktrace is from 2.9.0-alpha04 tho.
Fatal Exception: 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:620)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch(AndroidUiDispatcher.android.kt:79)
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(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
so...@google.com <so...@google.com> #4
co...@gmail.com <co...@gmail.com> #5
Seeing this pop up again for us on some Samsung Galaxy S24 running Android 14.
navigation-compose 2.8.5
Fatal Exception: 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:620)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
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(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
so...@google.com <so...@google.com> #6
I am using navigation-compose = "2.8.6"
and the same error is thrown.
The majority of devices affected are:
- samsung dm3q
- samsung a52q
- realme REE2ADL1
- samsung b2q
Exception 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:620)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
at androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:79)
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
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
co...@gmail.com <co...@gmail.com> #7
Same issue:
Exception 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:620)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:100)
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
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:588)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
co...@gmail.com <co...@gmail.com> #8
I experience the same issue when calling popBackStack(), but not every time. There is no clear pattern to when the javaIndexOutOfBoundsException: Index -1 out of bounds for length 1
java error occurs. Sometimes it happens after one attempt, but other times it takes up to 20 attempts.
In version 2.8.7 of the library, the exception is simply caught and ignored? That doesn’t seem like a proper solution to me.
vv...@google.com <vv...@google.com> #9
My workaround for this is to use android:enableOnBackInvokedCallback="@bool/atLeastSdk35"
in the manifest (for how to declare atLeastSdk35
see:
Since predictive back is only enabled by default for Android 15+ devices, this is an acceptable workaround for me. The only downside being that Android 14 devices opted in to predictive back, won't actually get predictive back enabled for the app, but that beats crashing.
al...@gmail.com <al...@gmail.com> #10
BackHandler(
onBack = onBackPressed
)
basically the will override the predicted back gesture (Currently that is the issue)
al...@gmail.com <al...@gmail.com> #11
Seems like this feature is more trouble than it's worth
al...@gmail.com <al...@gmail.com> #12
Navigation library used: 2.8.0-alpha10
The crash happens when popBackStack() is called. it happens randomly though. However one way to reproduce this a bit more consistently, was to double tap on the software back (navigation toolbar) button quickly.
Description
What
User experience
What type of Android issue is this?
Display or Rendering
What steps would let us observe this issue?
What did you expect to happen?
Device to wake with brightness settings the same
What actually happened?
Screen brightness at 0%
What was the effect of this issue on your device usage, such as lost time or work?
None - device worked normally
Additional comments
Has occured 3 times since install of Android 16 Dev Preview 1.
When
Time and frequency
When did this happen?
Nov 19, 2024 10:56 PM GMT-05:00
How often has this happened?
Occasionally
Where
Component
Suggested component: <not visible> (1684638)
Build and device data
- Build Number: google/komodo_beta/komodo:Baklava/BP21.241018.009/12628839:user/release-keys
(Note: It is the build when sending this report. For exact build reference, please see the attached bugreport.)
Debugging information
Google Play services
com.google.android.gms
Version 244433036 (24.44.33 (260408-694629214))
System App (Updated)
Android System WebView
com.google.android.webview
Version 661308832 (128.0.6613.88)
System App (Updated)
Network operator: Visible
SIM operator: Visible
Filed by Android Beta Feedback. Version (Updated): 2.46-betterbug.external_20241023_RC01 (DOGFOOD)https://developer.android.com/preview/feedback#feedback-app .
To learn more about our feedback process, please visit