https://kotlinlang.org logo
Title
l

Lucien Guimaraes

04/12/2023, 10:35 AM
Hello, I bump my project to Compose 1.4 and find an odd crash with `BottomSheetScaffold`: if the BottomSheetValue == Expanded when I nav to another screen and then nav back to the screen with the BottomSheetScaffold, the app crash with the following exception:
java.lang.IllegalStateException: The offset was read before being initialized. Did you access the offset in a phase before layout, like effects or composition?
Is this an intended behavior and we have to collapse the bottomSheet before leaving composition or a bug? Thanks!
j

jim

04/12/2023, 10:40 AM
I believe we fixed this in
1.5.0-alpha01
as per https://issuetracker.google.com/issues/266780234
l

Lucien Guimaraes

04/12/2023, 10:47 AM
It keeps crashing with
1.5.0-alpha01
in my case
j

jim

04/12/2023, 10:59 AM
In that case, I would suggest filing a new bug with a minimal repro that demonstartes the crash, and mention that you tested with
1.5.0-alpha01
l

Lucien Guimaraes

04/12/2023, 12:50 PM
s

shikasd

04/12/2023, 9:47 PM
@jossiwolf ^^
j

jossiwolf

04/13/2023, 8:05 PM
The issue @jim linked is about ModalBottomSheetLayout, we fixed a similar issue with BottomSheetScaffold in https://developer.android.com/jetpack/androidx/releases/compose-material#1.5.0-alpha02
Apologies, the fix for BottomSheetScaffold has not been released yet. It will be released as part of the next alpha release!