Repository navigation
Getting production crash on 0.83,Fatal Exception: java.lang.IllegalStateException addViewAt: failed to insert view [288] into parent [290] at index 0 #57017
Description
Activity
- addedNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
on Jun 1, 2026 Warning
Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.
Warning
Missing reproducer: We could not detect a reproducible example in your issue report. Reproducers are mandatory and we can accept only one of those as a valid reproducer:
- For majority of bugs: send us a Pull Request with the RNTesterPlayground.js edited to reproduce your bug.
- If your bug is UI related: a Snack
- If your bug is build/upgrade related: a project using our Reproducer Template
You can read more about about it on our website: How to report a bug.Warning
Could not parse version: We could not find or parse the version number of React Native in your issue report. Please use the template, and report your version including major, minor, and patch numbers - e.g. 0.76.2.
@mksmanishp Please share your package.json for inspecting what packages are using.
this is my package.json file
{
"name": "",
"version": "0.0.1",
"private": true,
"scripts": {
"android": "react-native run-android",
"ios": "react-native run-ios",
"lint": "eslint .",
"start": "react-native start",
"test": "jest",
"tsc": "tsc",
"typecheck": "tsc --noEmit",
"format": "prettier --check src || (echo 'Formatting files...' && prettier --write src)",
"lint:fix": "eslint src --fix ",
"iphone": "npm run ios -- --simulator='iPhone 16'",
"pod-install": "cd ios && RCT_NEW_ARCH_ENABLED=1 bundle exec pod install",
"postinstall": "npx patch-package",
"generate-apk": "cd android && ./gradlew assembleRelease",
"android1": "react-native run-android --active-arch-only",
"android:dev": "ENVFILE=.env.dev react-native run-android",
"android:live": "ENVFILE=.env.live react-native run-android",
"android:release:dev": "cd android && ENVFILE=.env.dev ./gradlew assembleRelease",
"android:release:live": "cd android && ENVFILE=.env.live ./gradlew assembleRelease",
"android:aab:live": "cd android && ENVFILE=.env.live ./gradlew bundleRelease"
},
"dependencies": {
"@d11/react-native-fast-image": "^8.1.7",
"@hookform/resolvers": "^3.4.0",
"@invertase/react-native-apple-authentication": "^2.4.0",
"@notifee/react-native": "9.1.8",
"@react-native-async-storage/async-storage": "^2.0.0",
"@react-native-clipboard/clipboard": "^1.16.0",
"@react-native-community/netinfo": "^12.0.0",
"@react-native-documents/picker": "^10.1.3",
"@react-native-firebase/analytics": "^22.0.0",
"@react-native-firebase/app": "^22.0.0",
"@react-native-firebase/auth": "^22.0.0",
"@react-native-firebase/crashlytics": "^22.0.0",
"@react-native-firebase/messaging": "^22.0.0",
"@react-native-google-signin/google-signin": "^11.0.0",
"@react-native/gradle-plugin": "^0.83.0",
"@react-navigation/bottom-tabs": "^6.5.11",
"@react-navigation/material-top-tabs": "^6.6.5",
"@react-navigation/native": "^6.0.8",
"@react-navigation/native-stack": "^6.9.17",
"@reduxjs/toolkit": "^2.1.0",
"@shopify/flash-list": "^2.0.0",
"axios": "^1.16.1",
"babel-plugin-module-resolver": "^5.0.2",
"date-fns": "^4.1.0",
"hyper-sdk-react": "^5.0.31",
"mixpanel-react-native": "^3.0.1",
"newrelic-react-native-agent": "^1.5.10",
"react": "19.2.0",
"react-hook-form": "^7.51.4",
"react-native": "^0.83.0",
"react-native-blob-util": "^0.21.2",
"react-native-calendars": "^1.1314.0",
"react-native-config": "^1.6.1",
"react-native-default-preference": "^1.4.4",
"react-native-device-info": "^11.0.0",
"react-native-encrypted-storage": "^4.0.3",
"react-native-fbsdk-next": "^12.1.4",
"react-native-geocoding": "^0.5.0",
"react-native-geolocation-service": "^5.3.1",
"react-native-gesture-handler": "^2.31.0",
"react-native-get-random-values": "^1.11.0",
"react-native-gifted-charts": "^1.4.76",
"react-native-image-picker": "^7.1.0",
"react-native-image-viewing": "^0.2.2",
"react-native-in-app-review": "^4.3.3",
"react-native-intersection-observer": "^0.2.1",
"react-native-linear-gradient": "^2.8.3",
"react-native-otp-verify": "^1.1.8",
"react-native-pager-view": "^6.8.1",
"react-native-permissions": "^4.1.1",
"react-native-reanimated": "^4.3.0",
"react-native-render-html": "^6.1.0",
"react-native-safe-area-context": "^5.0.0",
"react-native-screens": "^4.24.0",
"react-native-share": "^12.0.9",
"react-native-simple-toast": "^3.2.0",
"react-native-size-matters": "^0.4.2",
"react-native-svg": "^15.11.2",
"react-native-tab-view": "^3.5.2",
"react-native-toast-message": "^2.1.8",
"react-native-url-polyfill": "^2.0.0",
"react-native-uuid": "^2.0.1",
"react-native-webview": "^13.12.2",
"react-native-worklets": "^0.9.1",
"react-native-youtube-iframe": "^2.3.0",
"react-redux": "^9.1.0",
"redux-persist": "^6.0.0",
"redux-saga": "^1.3.0",
"uri-scheme": "^1.2.0",
"web-streams-polyfill": "^4.0.0",
"zod": "^3.23.8"
},
"devDependencies": {
"@babel/core": "^7.25.2",
"@babel/plugin-transform-class-static-block": "^7.26.0",
"@babel/preset-env": "^7.25.3",
"@babel/runtime": "^7.25.0",
"@react-native-community/cli": "^18.0.0",
"@react-native-community/cli-platform-android": "^18.0.0",
"@react-native-community/cli-platform-ios": "^18.0.0",
"@react-native/babel-preset": "^0.83.0",
"@react-native/eslint-config": "0.83.0",
"@react-native/metro-config": "^0.83.0",
"@react-native/typescript-config": "0.83.0",
"@rnx-kit/align-deps": "^3.0.6",
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
"@types/react": "^19.0.0",
"@types/react-test-renderer": "^18.0.0",
"babel-jest": "^29.6.3",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^8.19.0",
"jest": "^29.2.1",
"prettier": "^2.8.8",
"react-test-renderer": "19.2.0",
"typescript": "5.0.4"
},
"hyperSdkIOSVersion": "2.2.1",
"engines": {
"node": ">=18"
},
"rnx-kit": {
"kitType": "app",
"alignDeps": {
"requirements": [
"react-native@0.76"
],
"capabilities": [
"animation",
"babel-preset-react-native",
"clipboard",
"core",
"core-android",
"core-ios",
"core/metro-config",
"gestures",
"html",
"jest",
"navigation/native",
"netinfo",
"react",
"react-test-renderer",
"safe-area",
"screens",
"storage",
"webview"
]
}
}
}Reacted by Fardad Mohammadi- addedNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.and removed
on Jun 5, 2026 I am using 0.83.0, and I have this issue in release mode. I'm not sure about debug
@shameemkpofficial-git you got the solution for this,or which package is giving this error.
@mksmanishp found any solutions for this?
Reacted by Manish Kumarnot yet,still getting this
Reacted by sahiljena-jpg and Maciel RodriguesAlso facing this issue in 0.84.1
Reacted by Manish KumarReact native : #55177
Reanimate : software-mansion/react-native-reanimated#7493 (comment)
These might help, @mksmanishp if you are able to reproduce can you verify?
get the same error when flatlist has sticky headers enabled:
Exception java.lang.IllegalStateException: at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt (SurfaceMountingManager.kt:389) at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute (IntBufferBatchMountItem.kt:122) at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue (MountItemDispatcher.kt:379) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems$lambda$7$lambda$6 (MountItemDispatcher.kt:269) at com.facebook.react.fabric.mounting.MountItemDispatcher.$r8$lambda$4xp_oXLXKRRjXh_WfqmwhGWbzaM (MountItemDispatcher.kt) at com.facebook.react.fabric.mounting.MountItemDispatcher$$ExternalSyntheticLambda4.invoke (D8$$SyntheticClass) at com.facebook.react.internal.tracing.PerformanceTracer.trace (PerformanceTracer.kt:46) at com.facebook.react.internal.tracing.PerformanceTracer.trace (PerformanceTracer.kt:35) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems (MountItemDispatcher.kt:250) at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems (MountItemDispatcher.kt:94) at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded (FabricUIManager.java:1624) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame (GuardedFrameCallback.kt:42) at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1 (ReactChoreographer.kt:58) at com.facebook.react.modules.core.ReactChoreographer.$r8$lambda$nSkFhrr5T7rop_XKwzlLov4NLLw (ReactChoreographer.kt) at com.facebook.react.modules.core.ReactChoreographer$$ExternalSyntheticLambda0.doFrame (D8$$SyntheticClass) at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1645) at android.view.Choreographer$CallbackRecord.run (Choreographer.java:1656) at android.view.Choreographer.doCallbacks (Choreographer.java:1252) at android.view.Choreographer.doFrame (Choreographer.java:1177) at android.view.Choreographer$FrameDisplayEventReceiver.run (Choreographer.java:1630) at android.os.Handler.handleCallback (Handler.java:1095) at android.os.Handler.dispatchMessageImpl (Handler.java:135) at android.os.Handler.dispatchMessage (Handler.java:125) at android.os.Looper.loopOnce (Looper.java:269) at android.os.Looper.loop (Looper.java:367) at android.app.ActivityThread.main (ActivityThread.java:9333) at java.lang.reflect.Method.invoke at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:566) at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:929) Caused by java.lang.IndexOutOfBoundsException: at android.view.ViewGroup.addInArray (ViewGroup.java:5432) at android.view.ViewGroup.addViewInner (ViewGroup.java:5319) at android.view.ViewGroup.addView (ViewGroup.java:5126) at android.view.ViewGroup.addView (ViewGroup.java:5066) at com.facebook.react.views.view.ReactClippingViewManager.addView (ReactClippingViewManager.kt:36) at com.facebook.react.views.view.ReactClippingViewManager.addView (ReactClippingViewManager.kt:20) at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt (SurfaceMountingManager.kt:381)I have a similar crash, but my stack trace looks like:
Fatal Exception: java.lang.IllegalStateException: addViewAt: failed to insert view [756100] into parent [379414] at index 18 at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SurfaceMountingManager.kt:389) at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(IntBufferBatchMountItem.kt:122) at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(MountItemDispatcher.kt:379) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems$lambda$7$lambda$6(MountItemDispatcher.kt:269) at com.facebook.react.internal.tracing.PerformanceTracer.trace(PerformanceTracer.java:46) at com.facebook.react.internal.tracing.PerformanceTracer.trace(PerformanceTracer.java:35) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.kt:250) at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.kt:94) at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1624) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.kt:42) at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1(ReactChoreographer.java:58) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1036) at android.view.Choreographer.doCallbacks(Choreographer.java:846) at android.view.Choreographer.doFrame(Choreographer.java:776) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1023) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7941) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Caused by java.lang.IndexOutOfBoundsException: index=18 count=17 at com.facebook.react.views.view.ReactViewGroup.addInArray(ReactViewGroup.kt:818) at com.facebook.react.views.view.ReactViewGroup.addViewWithSubviewClippingEnabled$ReactAndroid_release(ReactViewGroup.kt:687) at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.kt:34) at com.facebook.react.views.view.ReactClippingViewManager.addView(ReactClippingViewManager.kt:20) at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SurfaceMountingManager.kt:381) at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(IntBufferBatchMountItem.kt:122) at com.facebook.react.fabric.mounting.MountItemDispatcher.executeOrEnqueue(MountItemDispatcher.kt:379) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems$lambda$7$lambda$6(MountItemDispatcher.kt:269) at com.facebook.react.internal.tracing.PerformanceTracer.trace(PerformanceTracer.java:46) at com.facebook.react.internal.tracing.PerformanceTracer.trace(PerformanceTracer.java:35) at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems(MountItemDispatcher.kt:250) at com.facebook.react.fabric.mounting.MountItemDispatcher.tryDispatchMountItems(MountItemDispatcher.kt:94) at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1624) at com.facebook.react.uimanager.GuardedFrameCallback.doFrame(GuardedFrameCallback.kt:42) at com.facebook.react.modules.core.ReactChoreographer.frameCallback$lambda$1(ReactChoreographer.java:58) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1036) at android.view.Choreographer.doCallbacks(Choreographer.java:846) at android.view.Choreographer.doFrame(Choreographer.java:776) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1023) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:201) at android.os.Looper.loop(Looper.java:288) at android.app.ActivityThread.main(ActivityThread.java:7941) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:553) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)We hit this on 0.86.0 and captured what this issue is missing: a logcat showing what happens immediately before the fatal, plus a measured reproduction rate. I think it identifies the root cause.
The crash is caused by the recovery two instructions earlier
addViewAtalready handles a missing ViewState softly — it logs aReactNoCrashSoftExceptionand returns. But returning skips the insert while Fabric's indices keep counting, so the parent's realchildCountis now out of step with the indices the rest of the batch was computed against. The next insert into that same parent is the one that dies.Both lines, 23 ms apart:
13:20:48.261 E/unknown:SurfaceMountingManager:MissingViewState: com.facebook.react.bridge.ReactNoCrashSoftException: Unable to find viewState for tag: [480] for addViewAt 13:20:48.285 E/AndroidRuntime: FATAL EXCEPTION: main java.lang.IllegalStateException: addViewAt: failed to insert view [1712] into parent [482] at index 1 at SurfaceMountingManager.addViewAt(SurfaceMountingManager.kt:389) at IntBufferBatchMountItem.execute(IntBufferBatchMountItem.kt:122) at MountItemDispatcher.dispatchMountItems(MountItemDispatcher.kt:250) at FabricUIManager$DispatchUIFrameCallback.doFrameGuarded(FabricUIManager.java:1624) Caused by: java.lang.IndexOutOfBoundsException: index=1 count=0 at android.view.ViewGroup.addInArray(ViewGroup.java:5404)- Batch inserts child
480into parent482. Tag480has no ViewState. - The missing-ViewState branch logs and returns. Nothing is inserted.
- Parent
482still has zero children when the next instruction inserts1712at index 1. addViewthrows.
count=0is the tell: it is not an off-by-one, it is a parent that received none of its children.View-tag topology at the crash
482— the failing parent: long-lived, low-numbered, child of496←530, in the root / tab-bar region480— the skipped child: absent from the surface's view-state map entirely1712— freshly created492,500,504,506,508— all present withparentTag=null, orphaned
A half-applied mount batch for a tab transition.
Reproduction rate: 1 in 12 on a fixed binary
Nondeterministic. Trigger: tapping a bottom-tab button while another tab's screen is fully mounted — in our case a screen with a nested tab bar, a horizontal carousel and a lazy list.
Twelve attempts across four UI-test uploads of the same APK (same bytes, not merely the same commit), one crash. Nine of those twelve come from a second test that executes a byte-identical path through the same tap, so it is a controlled comparison of the same step rather than of different code.
Correlated signal:
EGL_emulation: app_time_stats: avg=23606.17ms count=1— a single 23.6-second frame interval — logged 180 ms before the fatal batch. The crashing run also finished ~30% faster than the passing runs. Both suggest the device was badly stalled going into an unusually large or interleaved batch.Environment: RN 0.86.0, New Architecture, Hermes, Android 14 (API 34), Pixel 6 emulator, release build.
Why the existing fixes do not cover it
- [Android][Fabric] addViewAt hard-crashes on a placeholder ViewState synthesised by updateEventEmitter #58526 is a ViewState that exists with a null
view(a placeholder synthesised byupdateEventEmitter), which passes the null guard and dies atcheckNotNull(view). Here the ViewState is absent, so the guard fires correctly and the crash lands on the following instruction instead. - Fix IllegalStateException in SurfaceMountingManager.removeViewAt (#57860) #57860 (merged, backported to 0.86/0.87) only touches
removeViewAtand adds no bounds check.
A question rather than a patch
There seems to be a move toward converting hard throws in this class into soft exceptions with an early return — #57860 did it for
removeViewAt, and #58527 proposes it for the placeholder case inaddViewAt.If the trace above is right, that pattern has a systematic side effect: every silently skipped mutation leaves the native child count out of step with the indices the rest of the batch was computed against, so the crash relocates to the next instruction rather than going away. Our fatal is exactly that relocation.
Two directions, and we genuinely cannot tell which is correct from outside the renderer's invariants:
- Clamp
indexto the parent's child count beforeaddView— stops the crash, but trades it for silently wrong sibling ordering. - Treat a skipped mutation as invalidating the remaining mutations for that parent in the batch — the remaining indices are known stale, but we have no idea what that costs.
One detail if anyone does take (1): the bound has to be the view manager's
getChildCount(parent), notViewGroup.childCount.ReactClippingViewManager.getChildCountreturnsallChildrenCountwhenremoveClippedSubviewsis on, and that is the index spaceaddViewis being driven with — clamping toViewGroup.childCountwould clamp legitimate indices and misorder children on healthy clipping parents.Happy to supply the full logcat, the screen recording, or the complete hierarchy dump.
- Batch inserts child
Second occurrence, three days on, and one detail makes it much less random than I thought: the view tags are identical.
Both crashes, same tags
addViewAt: failed to insert view [1712] into parent [482] at index 11712into482, at index 1 — byte for byte the same pair on 2026-09-18 and again on 2026-09-21, on different builds several days of commits apart. Preceded both times by theMissingViewStatesoft exception for a tag absent from the surface's view-state map, 23 ms before the first fatal and 5 ms before the second.That is not what a random mount race looks like. Parent
482is a stable, structurally-identified container — low-numbered and long-lived, in the root / tab-bar region of our tree. Whatever this is, it recurs at the same position in the hierarchy.The trigger is switching bottom tabs, not one screen
- 2026-09-18: tap on the profile tab, while a creator-profile screen was fully mounted
- 2026-09-21: tap on the discover tab, bounds
[0,1180][202,1238]
Different destination, same container, same failing insert. In our app both are bottom-tab buttons in a React Navigation bottom tab navigator; the screen being left is a lazy-rendered tab screen with nested navigation.
Why I think the identical tags matter
If the fault were a general Fabric mount-ordering race, the tags should vary with whatever happened to be mounting. They do not. That points at a specific container repeatedly ending up with a stale child count — consistent with the mechanism in my earlier comment, where the missing-ViewState early return skips an insert and the next instruction into that same parent indexes past the end.
It also suggests this is reproducible for anyone whose tab bar sits at a similar position in the tree, which may explain why #52027 and this issue both describe "random" crashes that nobody can pin down.
Environment
react-native 0.86.0, New Architecture / Fabric, Hermes, Android 14 (API 34), Pixel 6 emulator, release build. Both crashes on emulator; we have shipped 0.86 to 1% of production users and have not yet seen it there, which is consistent with it needing scheduling pressure the emulator supplies more readily.
Happy to provide either full logcat, the recordings, or the hierarchy dumps — and if a maintainer wants a specific instrumented build run, we have a UI-test harness that hits this path repeatedly and can gather whatever would help.
Hit on 0.86.0, with a causal chain read from the shipped
SurfaceMountingManager.kt: a soft failure two instructions earlier leaves the parent with zero children, so the next insert at index 1 throws.No runnable reproducer — reason at the bottom. Posting because nobody in this thread has a diagnosis yet.
The chain: the soft failure causes the hard one
- A mount batch asks to insert child
480into parent482. Tag480has no ViewState — it is absent from the 700-line hierarchy dump entirely. SurfaceMountingManager.kt:337logsReactNoCrashSoftException: Unable to find viewState for tag: [480] for addViewAtand returns silently. The insert never happens.- Parent
482therefore still has zero children when the very next instruction asks to insert1712at index 1. - Line
389throwsIndexOutOfBoundsException: index=1 count=0, rethrown fatal.
E/unknown:SurfaceMountingManager:MissingViewState: com.facebook.react.bridge.ReactNoCrashSoftException: Unable to find viewState for tag: [480] for addViewAt E/AndroidRuntime: FATAL EXCEPTION: main java.lang.IllegalStateException: addViewAt: failed to insert view [1712] into parent [482] at index 1 at com.facebook.react.fabric.mounting.SurfaceMountingManager.addViewAt(SurfaceMountingManager.kt:389) at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute at com.facebook.react.fabric.mounting.MountItemDispatcher.dispatchMountItems at com.facebook.react.fabric.FabricUIManager$DispatchUIFrameCallback.doFrameGuarded Caused by: java.lang.IndexOutOfBoundsException: index=1 count=0That explains the shape everyone is reporting: the thrown pair is always a low parent tag and a freshly created child, because the parent is a long-lived container whose earlier insert was dropped.
Topology, trigger and rate
Tag topology at the time.
482←496←530, a long-lived low-numbered container in the root/tab-bar region;1712freshly created;492,500,504,506,508all orphaned atparentTag=null. That is a half-applied mount batch for a tab transition.Trigger and conditions. A tab switch —
tapOnthe profile tab, 63 s into a session, not during any other operation.EGL_emulation: app_time_stats: avg=23606.17ms count=1, a single 23.6-second frame interval, is logged 180 ms before the fatal batch. The device was severely stalled going in. Our crashing run also finished in 115 s where passing runs take 158–167 s, so it is an outlier in duration as well as outcome.Reproduction rate: 1 in 12, on a byte-identical binary. Three repeat runs of the same APK gave nine clean passes, plus three more prefix-identical passes inside the crashing run itself. One flow in those runs is byte-identical through the failing step, so it is a control for that exact step.
Why #58526's patch would not have helped
On #58526 — it looks like the same bug by title but is a different branch. Its patch guards
checkNotNull(view), i.e. an existing ViewState whoseviewis null. Ours is a ViewState that is absent entirely, which 0.86.0 already handles softly and correctly at line 337. That patch would not have saved us.The one guard that does not exist is a bounds check on
indexbeforeaddView. ClampingindextoparentView.childCountwould turn the crash into a soft exception, at the cost of silently wrong sibling ordering — a real trade in a renderer invariant, which is why we have not shipped it ourselves.Why no reproducer
The bot's requirement is understood, and we cannot meet it: at 1-in-12 under a severe frame stall this does not survive reduction to an
RNTesterPlayground.js. What makes it fire is the stall, not a component tree we could hand over. If a maintainer wants the full logcat, the hierarchy dump or the frame timings, say so and we will attach them.- A mount batch asks to insert child
Description
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [288] into parent [290] at index 0
Steps to reproduce
crash on everywhere on production app
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [288] into parent [290] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [9134] into parent [9136] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [7394] into parent [7396] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [8126] into parent [8128] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [8528] into parent [8530] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [288] into parent [290] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [9636] into parent [9638] at index 0
Fatal Exception: java.lang.IllegalStateException
addViewAt: failed to insert view [21668] into parent [21670] at index 0
React Native Version
0.83
Affected Platforms
Runtime - Android
Output of
npx @react-native-community/cli infoStacktrace or Logs
MANDATORY Reproducer
https://github.com/mksmanish
Screenshots and Videos
No response