Sagar Khurana
02/21/2026, 9:51 AM64 crashes for 51 users in the last 24 hoursSagar Khurana
02/21/2026, 9:52 AM1. Compose applies changes → RemoveNode → UiApplier.remove → LayoutNode.detach
2. AndroidComposeView.removeAndroidView → ViewGroup.removeViewInLayout
3. Android focus system fires synchronously: rootViewRequestFocus → requestFocus
4. AndroidComposeView.requestFocusBypassUnfocusableComposeView → focusSearch → twoDimensionalFocusSearch
5. searchBeyondBounds → LazyLayoutBeyondBoundsProviderModifierNode.layout → remeasureSync → forceRemeasure
6. SubcomposeLayout.subcompose → composeInitial → drainPendingModificationsForCompositionLocked → CRASH
Root issue: Compose doesn't guard against re-entrant subcomposition triggered by Android's native focus system during applyChangesInLocked. The focus cascade from removeViewInLayout is synchronous and escapes the Compose runtime's control.
Workaround: Adding focusProperties { canFocus = false } to the AndroidView modifier + FOCUS_BLOCK_DESCENDANTS on the native view. This prevents focus search from entering the ad subtree.
Question: Is this a known issue? Should the runtime guard against re-entrant composition from the focus system during the apply phase?shikasd
02/21/2026, 11:15 AMSagar Khurana
02/21/2026, 11:21 AMshikasd
02/21/2026, 11:25 AMSagar Khurana
02/21/2026, 5:52 PMisRemoveFocusedViewFixEnabled & isGetFocusedRectReturnEmptyEnabledSagar Khurana
02/21/2026, 6:03 PMisBypassUnfocusableComposeViewEnabled already defaults to true in our Compose UI 1.10.2, but we're still hitting the crash. The specific path is: AndroidView (NativeAdView) inside LazyVerticalStaggeredGrid is removed during content change → removeViewInLayout → rootViewRequestFocus → requestFocusBypassUnfocusableComposeView → searchBeyondBounds → re-entrant subcompose → crash. Should we also try isViewFocusFixEnabled = true? Or is this a gap in the current bypass flag's coverage?
@shikasd, sorry in advance to tag you again, just that now the crashes are above 100 for 90 users for the last 24 hours, thanks again already for all the helpshikasd
02/21/2026, 6:06 PMSagar Khurana
02/21/2026, 6:33 PMComposeUiFlags.isBypassUnfocusableComposeViewEnabled = false in Application.onCreate(), before super.onCreate() Build verified. Shipping in the next release.
For anyone following: this matches the recommendation in issuetracker.google.com/469958424#comment5 from the Compose UI team. Another company confirmed no side effects with ~200K users (comment #8). Google is actively working on removing this flag entirely (comment #6).
Thanks, @shikasd, for the quick pointer. It saved us a lot of debugging time. Hopefully, now i wont see this issue in the crashlytics 🤞Alex Vanyo
02/21/2026, 8:02 PMSagar Khurana
02/24/2026, 11:43 AM