Sagar Khurana
03/03/2026, 1:55 PMArrayIndexOutOfBoundsException in LazyStaggeredGridMeasure during LookaheadPass with StaggeredGridCells.Adaptive inside AnimatedPane
50+ crashes for 41 users in the last 7 daysSagar Khurana
03/03/2026, 1:55 PMkotlin.ArrayIndexOutOfBoundsException at LazyStaggeredGridMeasure.kt:269
Setup:
- LazyVerticalStaggeredGrid(columns = StaggeredGridCells.Adaptive(150.dp))
- Hosted in ListDetailPaneScaffold -> AnimatedPane
- Crash commonly occurs on back navigation (Detail -> Home)
Top of stack:
ThrowArrayIndexOutOfBoundsException (RuntimeUtils.kt:41)
LazyStaggeredGridMeasure.measure (LazyStaggeredGridMeasure.kt:269)
rememberStaggeredGridMeasurePolicy (LazyStaggeredGridMeasure.kt:184)
LazyLayout (Composer.kt:189)
InnerNodeCoordinator.LookaheadDelegateImpl.measure (MeasurePolicy.kt:88)
CupertinoOverscrollNode.measure (Measurable.kt:30)
LayoutModifierNodeCoordinator.LookaheadDelegateForLayoutModifierNode.measure
LookaheadPassDelegate.remeasure (OwnerSnapshotObserver.kt:138)
LookaheadPassDelegate.measure (LookaheadPassDelegate.kt:404)
BoxMeasurePolicy.measure (Measurable.kt:30)
No app code at throw site, entirely within Compose framework.
Questions:
1) Is this a known issue for LookaheadScope + LazyVerticalStaggeredGrid + Adaptive columns on iOS?
2) Is there an existing issue ID / planned fix?
3) Should staggered grid measure guard lane-count changes across lookahead/actual passes?Mark Murphy
03/03/2026, 2:00 PMSagar Khurana
03/05/2026, 8:38 PMAdaptive with Fixed(N) computed via BoxWithConstraints, so the lane count is determined once at composition time, not per measurement pass. Shipping it now and will keep an eye on crash reports post-release. We also added our findings to the issue tracker. Thanks again for the quick pointer!