Skip to content

[Sentry: APP-H7A] Fabric removeViewAt crashes removing view from non-ViewGroup parent #103369

Closed

Description

@mountiny

Sentry

https://expensify.sentry.io/issues/APP-H7A — IllegalStateException: Unable to remove a view from a view that is not a ViewGroup

Impact (snapshot at filing, 2026-10-07)

  • Users (total since first seen): 109
  • Events: 114
  • Users (last 14d): 21
  • First seen: 2026-07-07
  • Last seen: now (ongoing)
  • Platform: Android, HybridApp (org.me.mobiexpensifyg)
  • App version(s): 9.4.31 through 9.5.1-1, including every build after the APP-7AR fix (9.4.93-3, 9.4.94-0, 9.4.99-2, 9.5.0-5, 9.5.1-1)
  • Affected route(s) (parameterized): n/a — native Fabric mounting, not a JS route
  • Mechanism: UncaughtExceptionHandler, level fatal

Stack trace (top frames, first-party only)

com.facebook.react.fabric.mounting.SurfaceMountingManager.removeViewAt(SurfaceMountingManager.kt:445)
com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(IntBufferBatchMountItem.kt:125)
com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(MountItemDispatcher.kt:379)
com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.kt:250)
com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1664)

Error: IllegalStateException: Unable to remove a view from a view that is not a ViewGroup. ParentTag: N - Tag: M - Index: K

Suspected cause

SurfaceMountingManager.removeViewAt finds a ViewState for the parent tag, but its view is null or not a ViewGroup, and it throws (v0.86.0 source). The likely source is the same as APP-K0G: updateEventEmitter creates a placeholder ViewState with no view for a tag Java no longer has, or a differ flatten/unflatten bug leaves a stale parent.

This is not the APP-7AR root cause. Fix Android Fabric mount crashes from merged mounting transactions dropped APP-7AR to near zero, but APP-H7A kept its rate: 24 events in the 14 days before 9.4.93-3, 18 in the 13 days after.

Upstream already handles this case. react-native@3f553d7 replaces the throw with a soft exception, because a non-ViewGroup holds no children and the remove is a no-op. That commit landed after 0.86.0. A backport as a new RN patch should stop the crash, the same way #102901 handles addViewAt for APP-K0G.

Reproduction

Unknown — see Sentry events linked from the Sentry issue. Most users hit it once, which fits a timing race in mount batches.

Related

Issue OwnerCurrent Issue Owner: @collectioneur

Activity

  1. melvin-bot commented on Oct 9, 2026

    @melvin-bot

    @mountiny @collectioneur

    The solution for this issue has been 🚀 deployed to production 🚀 in version 9.5.6-6 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions