Status Update
Comments
jb...@google.com <jb...@google.com> #2
This is a particularly hard device to come by - do you happen to have access to the device? If so could you provide us with the output of: adb shell dumpsys media.camera > info.txt
Thanks!
ax...@gmail.com <ax...@gmail.com> #3
Stacktrace:
Caused by: java.lang.IllegalArgumentException: Can not get supported output size under supported maximum for the format: 34
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes(SupportedSurfaceCombination.java:355)
at androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions(SupportedSurfaceCombination.java:197)
at androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions(Camera2DeviceSurfaceManager.java:198)
at androidx.camera.core.CameraX.calculateSuggestedResolutions(CameraX.java:943)
at androidx.camera.core.CameraX.bindToLifecycle(CameraX.java:293)
at androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle(ProcessCameraProvider.java:227)
Below are some findings based on our debugging
When Dex is connected
previewConfig.getMaxResolution() is returning "731x411" as maxSize.
Inside Preview.Builder.build() -> Default_MAX_resolution is set to "CameraX.getSurfaceManager().getPreviewSize()" which is 731x411
this is being picked as maxSize.
While rendering maxSize is 731x411 and minSize is 640x480 and below are available outputSizes
0 = {Size@11860} "4032x3024"
1 = {Size@11861} "3984x2988"
2 = {Size@11862} "4032x2268"
3 = {Size@11863} "3024x3024"
4 = {Size@11864} "2976x2976"
5 = {Size@11865} "3840x2160"
6 = {Size@11866} "3264x2448"
7 = {Size@11867} "4032x1960"
8 = {Size@11868} "2880x2160"
9 = {Size@11869} "3264x1836"
10 = {Size@11870} "2160x2160"
11 = {Size@11871} "2560x1440"
12 = {Size@11872} "2224x1080"
13 = {Size@11873} "2048x1152"
14 = {Size@11874} "1920x1080"
15 = {Size@11875} "1440x1080"
16 = {Size@11876} "1088x1088"
17 = {Size@11877} "1280x720"
18 = {Size@11878} "1024x768"
19 = {Size@11879} "1056x704"
20 = {Size@11880} "960x720"
21 = {Size@11881} "960x540"
22 = {Size@11882} "720x720"
23 = {Size@11883} "800x450"
24 = {Size@11884} "720x480"
25 = {Size@11885} "640x480"
26 = {Size@11886} "352x288"
27 = {Size@11887} "320x240"
28 = {Size@11888} "256x144"
29 = {Size@11889} "176x144"
and couldn't find any size in this range.
When Dex not connected
minsize = 640x480
maxsize = 1920x1080
0 = {Size@11836} "4032x3024"
1 = {Size@11837} "3984x2988"
2 = {Size@11838} "4032x2268"
3 = {Size@11839} "3024x3024"
4 = {Size@11840} "2976x2976"
5 = {Size@11841} "3840x2160"
6 = {Size@11842} "3264x2448"
7 = {Size@11843} "4032x1960"
8 = {Size@11844} "2880x2160"
9 = {Size@11845} "3264x1836"
10 = {Size@11846} "2160x2160"
11 = {Size@11847} "2560x1440"
12 = {Size@11848} "2224x1080"
13 = {Size@11849} "2048x1152"
14 = {Size@11850} "1920x1080"
15 = {Size@11851} "1440x1080"
16 = {Size@11852} "1088x1088"
17 = {Size@11853} "1280x720"
18 = {Size@11854} "1024x768"
19 = {Size@11855} "1056x704"
20 = {Size@11856} "960x720"
21 = {Size@11857} "960x540"
22 = {Size@11858} "720x720"
23 = {Size@11859} "800x450"
24 = {Size@11860} "720x480"
25 = {Size@11861} "640x480"
26 = {Size@11862} "352x288"
27 = {Size@11863} "320x240"
28 = {Size@11864} "256x144"
29 = {Size@11865} "176x144"
and we have 12 available sizes in this range
Camera2DeviceSurfaceManager.java:: getPreviewSize()
mCameraSupportedSurfaceCombinationMap.get(cameraId).getSurfaceDefinition().getPreviewSize() = "1920x1080"
cameraId=0
jo...@meterapp.co <jo...@meterapp.co> #4
The issue root cause is that CameraX will default filter out sizes smaller than 640x480. For Preview, the max size will be limited to under display size. I checked the HW spec info for the issue related devices. Display size of FUJITSU F-04J/F-05J is 360x640. That will result int that no size exists in the conditions that is larger or equal to 640x480 and smaller or equal to 360x640.
A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
For device FUJITSU arrowsM04, I checked its HW spec info and its display size I found is 1280x720. It seems that the problem should not exist in the device.
Could you confirm that the problem exist on arrowsM04 device? What will be the returned value when using Display#getRealSize to obtain the display size?
jo...@meterapp.co <jo...@meterapp.co> #5
> A temporary workaround for this situation is to use Preview.Builder#setTargetResolution() to set a size smaller than 640x480 to bypass the problem.
OK. I will try it.
> Could you confirm that the problem exist on arrowsM04 device?
We receive the crash report (Crashlytics) that this crash has occurred on arrowsM04.
We don't have this device so we can't confirm that the problem really exist on arrowsM04.
> What will be the returned value when using Display#getRealSize to obtain the display size?
We can't investigate it for the same reason.
Thank you.
jb...@google.com <jb...@google.com>
fa...@gmail.com <fa...@gmail.com> #6
This issue happened on devices that the display size is smaller than 640x480. In original auto-resolution mechanism, supported sizes smaller than 640x480 will be default filter out.
The auto-resolution mechanism encodes the guaranteed configurations tables in CameraDevice#createCaptureSession(SessionConfiguration). It defines that the PREVIEW size is the small one of the device display size and 1080p. The PREVIEW size will be the maximal size limitation for Preview use case. The reason it limits the size to display size and 1080p is the stream output in display size or 1080p has been able to provide good enough preview quality. Therefore, auto-resolution mechanism will limit the selected size to be smaller than the small one of the device display size and 1080p.
With above two conditions, in this issue, all sizes smaller than 640x480 have been filter out, therefore, there is no size smaller than the display size 320x240 can be selected to use. And cause the exception.
Solution:
When the display size is smaller than 640x480, auto-resolution mechanism won't filter out those small sizes smaller than 640x480. This makes those small size be left and can be selected for the Preview use case on small display devices.
The solution has been merged and will be included in next CameraX release.
jo...@meterapp.co <jo...@meterapp.co> #7
Hello.
This crash still occurs.
- CAMERAX VERSION: 1.0.0-beta4
- ANDROID OS BUILD NUMBER: Android 7.1.1
- DEVICE NAME: FUJITSU F-02H
We receive following crash report from FUJITSU F-02H. So far We have received this crash report only from F-02H.
java.lang.IllegalArgumentException
Can not get supported output size under supported maximum for the format: 34
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSupportedOutputSizes (SupportedSurfaceCombination.java:349)
androidx.camera.camera2.internal.SupportedSurfaceCombination.getSuggestedResolutions (SupportedSurfaceCombination.java:197)
androidx.camera.camera2.internal.Camera2DeviceSurfaceManager.getSuggestedResolutions (Camera2DeviceSurfaceManager.java:198)
androidx.camera.core.CameraX.calculateSuggestedResolutions (CameraX.java:949)
androidx.camera.core.CameraX.bindToLifecycle (CameraX.java:351)
androidx.camera.lifecycle.ProcessCameraProvider.bindToLifecycle (ProcessCameraProvider.java:230)
(our application's package name).CameraFragment.bindCameraUseCases (CameraFragment.java:174)
ap...@google.com <ap...@google.com> #8
Could you help to provide the following information to clarify the issue?
1. Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
2. Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
jb...@google.com <jb...@google.com> #9
- Is the full name of the device Fujitsu Arrows NX F-02H that has a 1440x2560 display?
Yes
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
Since we don't have this device, we'll try to collect this information in the next version of our app. The next version will be released later this month.
jo...@meterapp.co <jo...@meterapp.co> #10
Hello.
- Please help to provide the supported output sizes of ImageFormat.PRIVATE that is obtained by StreamConfigurationMap#getOutputSizes(int).
We have collected the output of the device where the crash occurs.
Device1
- Model : arrows Be F-05J
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Device2
- Model : Fujitsu arrows M04
- Android Version : 7.1.1
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0: 480x480
CameraId 1: 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
Additional Information
CameraX version : 1.0.0-beta04
We collect the supported output sizes by following code.
val errorString = buildString {
append("The supported output sizes of ImageFormat.PRIVATE: ")
(requireContext().getSystemService(Context.CAMERA_SERVICE) as CameraManager).apply {
cameraIdList.forEachIndexed { index, cameraId ->
val msg = if (VERSION.SDK_INT >= VERSION_CODES.M) {
val configurationMap =
getCameraCharacteristics(cameraId).get(CameraCharacteristics.SCALER_STREAM_CONFIGURATION_MAP)
val sizes = configurationMap?.getOutputSizes(ImageFormat.PRIVATE)
"CameraId $index: ${sizes?.joinToString(" ,")}"
} else {
"CameraId $index: This device version is under M."
}
append(msg)
}
}
}
jb...@google.com <jb...@google.com> #11
jo...@meterapp.co <jo...@meterapp.co> #12
I tried to find the device specs and both 720x1280
size display. For the camera id 0 device, it is a different case that the display size is larger than 640x480
but the device only supports a 480x480
size. The case also caused the same IllegalArgumentException and was also fixed by 1.0.0-beta04
release. Before 480x480
size would be filtered out and then caused the IllegalArgumentException. After it was merged, the 640x480
size threshold was removed and then the 480x480
size would be kept and selected to use.
It looks like 1.0.0-beta04
release had been used to collect the supported sizes information. But the issue should have been fixed by 1.0.0-beta04
release. Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
CameraX's 1.0.0-beta04
version. Maybe you can also consider to upgrade to the latest 1.0.0-rc01
version for your application. Thanks.
jb...@google.com <jb...@google.com> #13
Did you only check the device model name to collect the supported sizes information or collect the information when the IllegalArgumentException issue happens again?
We collect informations only from the device on which IllegalArgumentException happened.
Our latest app uses CameraX version 1.0.0-beta10
and this issue still occurres.
However we don't receive crash report from Fujitsu arrows Be F-05J
or Fujitsu arrows M04
so far. (This doesn't mean this issue is fixed on these devices because our app is heavily rely on camera so these device's user wouldn't use our app anymore.)
Instead, we receive crash report from
- Model : Fujitsu F-03K
- Android Version : 7.1.2
- Supported output sizes of ImageFormat.PRIVATE
CameraId 0 : 480x480
CameraId 1 : 2048x1536 ,1920x1080 ,1280x720 ,960x720 ,640x480 ,320x240 ,176x144
jo...@meterapp.co <jo...@meterapp.co> #14
I missed some settings when I simulated the issue by robolectric test so that I was not able to reproduce it. Now, I can reproduce the issue if the device only supports one 480x480 resolution. I'm working on the solution and target to make it included in next release.
jo...@meterapp.co <jo...@meterapp.co> #15
Branch: androidx-main
commit 69d15dff7bb857ee33a0f643ff42a0f8bc475ab2
Author: charcoalchen <charcoalchen@google.com>
Date: Fri Jan 08 18:30:03 2021
Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Do not filter out sizes smaller than 640x480 when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480.
Relnote:"Fixed IllegalArgumentException issue happened when all preview supported sizes are smaller than 640x480 and display size is larger than 640x480."
Bug: 150506192
Test: SupportedSurfaceCombinationTest
Change-Id: I2a63ce8e2ad42a9cc060c8635ac3603bf440b1ec
M camera/camera-camera2/src/main/java/androidx/camera/camera2/internal/SupportedSurfaceCombination.java
M camera/camera-camera2/src/test/java/androidx/camera/camera2/internal/SupportedSurfaceCombinationTest.java
jb...@google.com <jb...@google.com> #16
kl...@gmail.com <kl...@gmail.com> #17
We're also seeing this crash without setting android:enableOnBackInvokedCallback
in AndroidManifest.xml
. I cannot provide a sample project, because I've not been able to reproduce this issue (with or without enableOnBackInvokedCallback
).
I haven't been able to test 1.10.0-SNAPSHOT
since I'm not able to reproduce the issue, but I'm fairly certain the commit linked above (enabled
switches to false, only the channel
is closed, but the CoroutineScope
in which the lambda run is still active. Since the Channel is buffered, it will deliver remaining events. Also the lambda in question does not have a suspension point before currentBackStack
is accessed. So even if the scope were cancelled, the code would still execute.
That said, wouldn't the easiest solution be to add
if (currentBackStack.size < 2) return
to the start of the PredictiveBackHandler
lambda in PredictiveBackHandler
being disabled and it returning immediately.
jo...@meterapp.co <jo...@meterapp.co> #18
The steps to repro the first crash are somewhat tricky and require good timing
1. Start the app in debug mode (or use a really old phone). This seems to help to reproduce the crash because it creates a bigger window for clicking the back button at the right time
2. Navigate to a new screen while simultaneously or a split second later pressing the back button. I mash the back button right after clicking on a button to open a screen
ha...@gmail.com <ha...@gmail.com> #19
For us Activity 1.9.2 didn't fix the issue.
pr...@google.com <pr...@google.com> #20
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
8h...@gmail.com <8h...@gmail.com> #21
Fatal Exception: java.lang.IndexOutOfBoundsException
Index -1 out of bounds for length 1
jdk.internal.util.Preconditions.outOfBounds (Preconditions.java:64)
jdk.internal.util.Preconditions.outOfBoundsCheckIndex (Preconditions.java:70)
jdk.internal.util.Preconditions.checkIndex (Preconditions.java:266)
java.util.Objects.checkIndex (Objects.java:359)
java.util.ArrayList.get (ArrayList.java:434)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invokeSuspend (NavHost.kt:518)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke (NavHost.kt:13)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke (NavHost.kt:13)
androidx.activity.compose.OnBackInstance$job$1.invokeSuspend (PredictiveBackHandler.kt:160)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:81)
androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch (AndroidUiDispatcher.android.kt:41)
androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run (AndroidUiDispatcher.android.kt:57)
android.os.Handler.handleCallback (Handler.java:942)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loopOnce (Looper.java:240)
android.os.Looper.loop (Looper.java:351)
android.app.ActivityThread.main (ActivityThread.java:8436)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:568)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1013)
Operating systems 72% Android 13
Device states 0% background
57% Oppo 15% Motorola 14% Oppo 14% Vivo
Fatal Exception: java.lang.ArrayIndexOutOfBoundsException
length=10; index=-1
java.util.ArrayList.get (ArrayList.java:439)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invokeSuspend (NavHost.kt:518)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke (NavHost.kt:13)
androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke (NavHost.kt:13)
androidx.activity.compose.OnBackInstance$job$1.invokeSuspend (PredictiveBackHandler.kt:160)
kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith (ContinuationImpl.kt:33)
kotlinx.coroutines.DispatchedTask.run (DispatchedTask.kt:104)
androidx.compose.ui.platform.AndroidUiDispatcher.performTrampolineDispatch (AndroidUiDispatcher.android.kt:81)
androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch (AndroidUiDispatcher.android.kt:41)
androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.run (AndroidUiDispatcher.android.kt:57)
android.os.Handler.handleCallback (Handler.java:790)
android.os.Handler.dispatchMessage (Handler.java:99)
android.os.Looper.loop (Looper.java:192)
android.app.ActivityThread.main (ActivityThread.java:6754)
java.lang.reflect.Method.invoke (Method.java)
com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:549)
com.android.internal.os.ZygoteInit.main (ZygoteInit.java:828)
Operating systems 75% Android 11
Device states 0% background
25% Vivo 25% Motorola 25% Samsung 25% Xiaomi
androidGradlePlugin = "8.6.0"
androidxActivity = "1.9.2"
androidxCore = "1.13.1"
androidxComposeBom = "2024.09.00"
androidxComposeMaterial3 = "1.3.0"
androidxComposeRuntimeTracing = "1.0.0-beta01"
androidxConstraintLayoutCompose = "1.0.1"
androidxHiltNavigationCompose = "1.2.0"
androidxNavigation = "2.8.0"
jo...@meterapp.co <jo...@meterapp.co> #22
il...@google.com <il...@google.com> #23
Re
jb...@google.com <jb...@google.com>
ud...@gmail.com <ud...@gmail.com> #24
composeBom = "2024.09.02"
navigation = "2.8.1"
activityCompose = "1.9.2"
appcompat = "1.7.0"
fa...@cosmoconnected.com <fa...@cosmoconnected.com> #25
It can be reproduced easily when fast navigation between menu.
enableOnBackInvokedCallback="true"
navigation = "2.8.1"
activityCompose = "1.9.2"
appcompat = "1.7.0"
ap...@google.com <ap...@google.com> #26
Project: platform/frameworks/support
Branch: androidx-main
Author: Jeremy Woods <
Link:
Fix failing PredictiveBackHandler enabled changes
Expand for full commit details
Fix failing PredictiveBackHandler enabled changes
As part of asop/3164566 we attempted to fix an error with
PredictiveBackHandler by closing the internal onBackInstance when the
enabled status changed. This would have worked, except by the time we
made it to the LaunchedEffect the onBackInstance was always null, so we
weren't closing anything.
I believe the cause of this is that `onBackInstance` was a field of a
function and we couldn't reference it across different calls. Because we
needed to change it as part of the backCallback, it also could not be
remembered.
So instead of using the onBackInstance, we can just use the callback
`isEnabled` state directly by passing the callback to the
`OnBackInstance`. This ensures that we only fire the `onBack` callback
when the function is actually enabled.
Test: PredictiveBackHandlerTest, tested and confirmed in sample app
Bug: 365027664
Bug: 340202286
RelNote: "`PredictiveBackHandler` will no longer fire it's callback
after the handler has been disabled. This will fix an issue where
the `NavHost` from Navigation Compose would throw an
`IndexOutOfBoundsException`."
Change-Id: I3f75eb2415f39b914f18cf4b87bf4ed57bb5a483
Files:
- M
activity/activity-compose/src/androidTest/java/androidx/activity/compose/PredictiveBackHandlerTest.kt
- M
activity/activity-compose/src/main/java/androidx/activity/compose/PredictiveBackHandler.kt
Hash: 1658eca1da25d8092f3cd48806946edcdec73688
Date: Thu Sep 26 18:15:59 2024
jb...@google.com <jb...@google.com> #27
This has been fixed internally and will be available in Activity 1.9.3
version.
nu...@idoctus.com <nu...@idoctus.com> #28
jo...@meterapp.co <jo...@meterapp.co> #29
This has been fixed internally and will be available in Activity 1.9.3 version.
So excited for that release, thank you for your persistence on this issue Jeremy!
Do we have a timeline for the Activity 1.9.3 release?
comment#28
The release most likely will be October 16th if it is getting released in the next release cycle that andoidx libraries have (2 week release cycle)
Activity 1.9.2 is scheduled for September 4th, but you can try out the fix now with snapshots.
comment#11
If you'd like to try it out earlier, this commit is most likely in the snapshots
na...@google.com <na...@google.com> #30
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.activity:activity-compose:1.9.3
jo...@meterapp.co <jo...@meterapp.co> #31
It seemed to address the crash on the 1.10.0 snapshot, will test 1.9.3 now that its in production and let the group know
la...@gmail.com <la...@gmail.com> #32
Thanks for this update! This has been affecting our users using navigation-compose = "2.8.2"
and activity-compose = "1.9.2"
.
bi...@gmail.com <bi...@gmail.com> #33
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: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:8919)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103)
jb...@google.com <jb...@google.com> #34
That stacktrace indicates that we have somehow collected back events without ever starting them? Do you have a minimal sample project that can reproduce that error?
bi...@gmail.com <bi...@gmail.com> #35
From what I see from Sentry :
- it seems to occur AFTER (a few seconds to a minute) my mainActivity got stopped/destroyed/detached.
- 100% of the affected users are with a SAMSUNG device and on Android 14
I don't get it..
Don't know if it's related but I have 2 nested navControllers/navHost (a main one, and one dedicated to handle bottomNavigation). But everything works smoothly and I'm not even sure if users "see" the bug occuring (got no complaints) ..
am...@gmail.com <am...@gmail.com> #36
at java.util.ArrayList.get(ArrayList.java:310)
at androidx.navigation.compose.NavHostKt$NavHost$25$1.invokeSuspend(NavHost.kt:518)
at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(NavHost.kt:1)
at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(NavHost.kt:2)
at androidx.activity.compose.OnBackInstance$job$1.invokeSuspend(PredictiveBackHandler.kt:154)
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$setScheduledFrameDispatch$p(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher.access$performTrampolineDispatch(AndroidUiDispatcher.android.kt:41)
at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:68)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:909)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:619)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:897)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:7406)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120)
does any one find the solution i'm using def nav_version = "2.8.0"
nu...@idoctus.com <nu...@idoctus.com> #37
li...@gmail.com <li...@gmail.com> #38
jb...@google.com <jb...@google.com> #39
Please file a new bug with a minimal sample project that reproduces this error.
jo...@meterapp.co <jo...@meterapp.co> #40
Same as above the stack trace changed but there is still a crash. Anyone know if its the same repro as before?
The steps to repro the first crash are somewhat tricky and require good timing
- Start the app in debug mode (or use a really old phone). This seems to help to reproduce the crash because it creates a bigger window for clicking the back button at the right time
- Navigate to a new screen while simultaneously or a split second later pressing the back button. I mash the back button right after clicking on a button to open a screen
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:611)
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$setScheduledFrameDispatch$p(AndroidUiDispatcher.android.kt:41)
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:257)
at android.os.Looper.loop(Looper.java:368)
at android.app.ActivityThread.main(ActivityThread.java:8839)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:572)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1049)
si...@gmail.com <si...@gmail.com> #41
I have created a new issue in
jo...@meterapp.co <jo...@meterapp.co> #42
I have created a new issue in
, as requested. https://issuetracker.google.com/issues/375343407
Thanks for reporting this! Its my biggest crash by fare, hopefully we can resolve soon
pr...@google.com <pr...@google.com> #43
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.activity:activity-compose:1.10.0-alpha03
sh...@gmail.com <sh...@gmail.com> #44
I also same issues, It was as though val previousEntry = currentBackStack[currentBackStack.size - 2]
, NavHost.kt
, didn't guard this situation.
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$25$1.invokeSuspend(NavHost.kt:518) at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(Unknown Source:8) at androidx.navigation.compose.NavHostKt$NavHost$25$1.invoke(Unknown Source:4) at androidx.activity.compose.OnBackInstance$job$1.invokeSuspend(PredictiveBackHandler.kt:121) 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:8919) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:578) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1103) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@5133892, androidx.compose.runtime.BroadcastFrameClock@757c263, StandaloneCoroutine{Cancelling}@92a1e60, AndroidUiDispatcher@a705f19]
sh...@gmail.com <sh...@gmail.com> #45
Additional information activity-compose: 1.10.0-alpha03 navigation-compose: 2.9.0-alpha02
[Deleted User] <[Deleted User]> #46
nu...@idoctus.com <nu...@idoctus.com> #47
ma...@gmail.com <ma...@gmail.com> #48
I was not seeing the crash when running 'androidx.navigation:navigation-compose:2.7.2'
jo...@meterapp.co <jo...@meterapp.co> #49
The resolution of this issue has unfortunately led to a new problem, which is now tracked under Issue
If there’s any way I can help get this new issue assigned to an owner or provide further information, please let me know.
Description
Component used: Navigation Version used: lastest Devices/Android versions reproduced on: any
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$17$1.invokeSuspend(NavHost.kt:342) at androidx.navigation.compose.NavHostKt$NavHost$17$1.invoke(Unknown Source:8) at androidx.navigation.compose.NavHostKt$NavHost$17$1.invoke(Unknown Source:4) at androidx.activity.compose.OnBackInstance$job$1.invokeSuspend(PredictiveBackHandler.kt:154) 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:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:204) at android.os.Looper.loop(Looper.java:291) at android.app.ActivityThread.main(ActivityThread.java:8134) 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:1019) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@5863fee, androidx.compose.runtime.BroadcastFrameClock@1b7ec8f, StandaloneCoroutine{Cancelling}@afd7b1c, AndroidUiDispatcher@d182325]