Has anyone else experienced this crash happening -...
# compose
c
Has anyone else experienced this crash happening -
Copy code
Fatal Exception: 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)
       at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(NavHost.kt:13)
       at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(NavHost.kt:13)
       at androidx.activity.compose.OnBackInstance$job$1.invokeSuspend(PredictiveBackHandler.kt:156)
       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: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:790)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loop(Looper.java:164)
       at android.app.ActivityThread.main(ActivityThread.java:7000)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:441)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1408)
I can see there is some issues raised on the issue tracker - https://issuetracker.google.com/issues?q=PredictiveBackHandler But doesn't seem to be a resolution at the moment in time, so just wondering if anyone has been able to put anything in place to prevent this from happening. The manifest changes that are suggested don't seem to make a difference
h
no one can help you without some code and a little bit of understanding of what’s going on
s
h
The following release(s) address this bug.It is possible this bug has only been partially addressed: •
androidx.activity:activity-compose:1.9.2
androidx.activity:activity-compose:1.10.0-alpha02
s
Yeap, we are making a release with this to see if it will actually be fixed for us too. Someone in the comments said it's not fixed for them, but who knows if it's true or there was some mistake in their testing. Chris, can you reliably reproduce the problem, or is it just part of your crashlytics reports?
c
So this is continuously happening when navigating back through the stack very quickly, whether this is using the software back button of a back button in the App bar. It is throwing the error in the snippet above with the index out of bounds error. It is part of our crashlytics reports but we can manually produce it 10 out of 10 times. I posted the issue tracker in the message above as there is a few reports now of this.
We are using
androidx.activity:activity-compose:1.9.2
and can replicate, just to check are you saying it's fixing the in alpha release
androidx.activity:activity-compose:1.10.0-alpha02
s
Was marked as duplicate of https://issuetracker.google.com/issues/365027664 Perhaps answer there if you are experiencing it still with 1.9.2 and optimally with some code sample too
👍 1
Thanks for adding it there, it seems like they can repro it as well now! Let's hope they get to fix this asap
🤞 1