Fixed
Status Update
Comments
ti...@google.com <ti...@google.com>
an...@google.com <an...@google.com>
Th...@parkmobileglobal.us <Th...@parkmobileglobal.us> #2
I'm seeing this as well, and it's happening after navigating to a screen that does not even use compose dependencies. Our flow is:
Non Compose fragment -> Compose fragment -> Non compose fragment -> This crash immediately
Currently troubleshooting, but coming up empty and cannot reproduce on my device, but seeing crashes on client devices.
Non Compose fragment -> Compose fragment -> Non compose fragment -> This crash immediately
Currently troubleshooting, but coming up empty and cannot reproduce on my device, but seeing crashes on client devices.
ch...@google.com <ch...@google.com> #3
What devices and API levels are you seeing this issue?
Th...@parkmobileglobal.us <Th...@parkmobileglobal.us> #4
Compose version: 1.2.1
Devices: Various devices, seen across Samsung/Pixels/Moto/etc.
Device API levels: Seen on Android 8-13
Devices: Various devices, seen across Samsung/Pixels/Moto/etc.
Device API levels: Seen on Android 8-13
do...@cloaked.id <do...@cloaked.id> #5
In my scenario in which I can reproduce this crash it seems to be related to Dialogs: I have a UI where I send off a network request and show a ProgressDialog while the request is being processed. Once the response is there, I dismiss the ProgressDialog and navigate back/remove the Composable that contains the ProgressDialog from the composition.
When the request takes some time to complete, it works perfectly fine. However, if the request is completed really quickly (i.e. when the device is in airplane mode) it crashes quite reliably. So my uneducated guess is that there's a race condition between the Dialog being 'fully initialized' and the Composable which houses the Dialog being removed from the composition.
Tested on:
Compose 1.3.1
Pixel 4 Emulator with API 29
When the request takes some time to complete, it works perfectly fine. However, if the request is completed really quickly (i.e. when the device is in airplane mode) it crashes quite reliably. So my uneducated guess is that there's a race condition between the Dialog being 'fully initialized' and the Composable which houses the Dialog being removed from the composition.
Tested on:
Compose 1.3.1
Pixel 4 Emulator with API 29
ch...@google.com <ch...@google.com> #6
Can you try to produce a project that reproduces this bug?
do...@cloaked.id <do...@cloaked.id> #7
It's a bit more complicated than I thought, but I managed to make a small project that reproduces the exact scenario from my app. What I left out before: The UI where the ProgressDialog is shown is a BottomSheetDialogFragment hosting a ComposeView. When the network request is done, I navigate back using the Navigation library.
See the attached project and most of the time it will crash when triggering the async work in the bottom sheet.
See the attached project and most of the time it will crash when triggering the async work in the bottom sheet.
ch...@google.com <ch...@google.com> #8
Thanks! I have the case reproducing locally. Working on a fix.
ap...@google.com <ap...@google.com> #9
Project: platform/frameworks/support
Branch: androidx-main
commit 8f8656f0b0ee7b6be1319835c658e1b10945470a
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Wed Nov 16 11:15:25 2022
Fix index out of bounds crash when cancelling the Recomposer
Cancelling the recomposer could result in a crash under certain
conditions when the recomposer has a pending lanched effect as well
as pending changes. This is occurs more often when showing a dialog
using navigation.
Fixes: 243862703
Test: ./gradlew :compose:r:r:tDUT
Change-Id: Id06d4b7ab171906ad7c6864d4807ed6014bb1ae3
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/RecomposerTests.kt
https://android-review.googlesource.com/2305731
Branch: androidx-main
commit 8f8656f0b0ee7b6be1319835c658e1b10945470a
Author: Chuck Jazdzewski <chuckj@google.com>
Date: Wed Nov 16 11:15:25 2022
Fix index out of bounds crash when cancelling the Recomposer
Cancelling the recomposer could result in a crash under certain
conditions when the recomposer has a pending lanched effect as well
as pending changes. This is occurs more often when showing a dialog
using navigation.
Fixes: 243862703
Test: ./gradlew :compose:r:r:tDUT
Change-Id: Id06d4b7ab171906ad7c6864d4807ed6014bb1ae3
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonTest/kotlin/androidx/compose/runtime/RecomposerTests.kt
[Deleted User] <[Deleted User]> #10
Hello, Do you know when this fix'll be embedded in next release ?
er...@1fit.app <er...@1fit.app> #11
Hello, do you know in which release this fix will come?
ju...@google.com <ju...@google.com> #12
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.compose.runtime:runtime:1.4.0-alpha03
Description
Jetpack Compose version: 1.1.1, 1.2.0
Jetpack Compose component(s) used: runtime
Not sure what causes this, perhaps
snapshotInvalidations
orknownCompositions
change during iteration. This crash is pretty common - about 20 crashes per day.