Skip to content

[Android][Fabric] SurfaceMountingManager.updatePadding still hard-crashes with RetryableMountingLayerException: Unable to find viewState in 0.86 (addViewAt/updateLayout were made soft) #58953

Closed as not planned

Description

@sangupandi

Description

Description: 0.86 stopped addViewAt, updateLayout, updateProps, deleteView and removeViewAt from crashing on a missing view, but updatePadding (line 876) still throws. It quotes the 0.86 source and lists the other operations that still throw (updateOverflowInset, updateState, setJSResponder, sendAccessibilityEvent). It also suggests a fix in the same style as updateLayout, and links #55177, #58526 and #58527.
Steps to reproduce: honest that it's a production race we can't reproduce on demand, with the device pattern: 100% Android 12 on 32-bit low-end phones, mostly vivo, during launch or quick tab switches. It also notes the crash ran about 3× higher through addViewAt on 0.82.
Versions: RN 0.86.0, React 19.2.8, New Architecture and Hermes on, and the versions of Reanimated, Screens, Gesture Handler, pager-view, bottom-sheet and React Navigation.
Stack trace: the full updatePadding trace. All sampled crashes share it; only the tag differs.
Reproducer: none available; offers to test a patched build.

Steps to reproduce

Honest that it's a production race we can't reproduce on demand, with the device pattern: 100% Android 12 on 32-bit low-end phones, mostly vivo, during launch or quick tab switches. It also notes the crash ran about 3× higher through addViewAt on 0.82.

React Native Version

0.86.0

Affected Platforms

Runtime - Android

Output of npx @react-native-community/cli info

N/A

Stacktrace or Logs

Fatal Exception: java.lang.IllegalStateException: Unable to remove a view from a view that is not a ViewGroup. ParentTag: 12156 - Tag: 12154 - Index: 0
       at com.facebook.react.fabric.mounting.SurfaceMountingManager.removeViewAt(SurfaceMountingManager.kt:444)
       at com.facebook.react.fabric.mounting.mountitems.IntBufferBatchMountItem.execute(IntBufferBatchMountItem.kt:125)
       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.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 android.view.Choreographer$CallbackRecord.run(Choreographer.java:1184)
       at android.view.Choreographer.doCallbacks(Choreographer.java:986)
       at android.view.Choreographer.doFrame(Choreographer.java:907)
       at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1171)
       at android.os.Handler.handleCallback(Handler.java:938)
       at android.os.Handler.dispatchMessage(Handler.java:99)
       at android.os.Looper.loopOnce(Looper.java:233)
       at android.os.Looper.loop(Looper.java:334)
       at android.app.ActivityThread.main(ActivityThread.java:8333)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1065)

MANDATORY Reproducer

n/A

Screenshots and Videos

No response

Activity

  1. added
    Needs: Repro
    Platform: Android
    on Oct 8, 2026
  2. react-native-bot commented on Oct 8, 2026

    @react-native-bot
    Collaborator

    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:


    You can read more about about it on our website: How to report a bug.

  3. shameemkpofficial-git commented on Oct 13, 2026

    @shameemkpofficial-git

    @sangupandi
    Check #58953 by making the SurfaceMountingManager methods use soft exception handling instead of hard-crashing.

    Changes made:

    0001-Fix-Make-SurfaceMountingManager-methods-soft-instead.patch

    • updatePadding
    • updateOverflowInset
    • updateState
    • receiveCommand (both overloads)
    • updateProps
    • addViewAt
    • removeViewAt
    • onViewStateDeleted

    These methods now use the elvis operator pattern (?: return) instead of checkNotNull/RetryableMountingLayerException, matching the behavior of updateLayout which was already fixed in 0.86.

    Test cases added: 5 test cases to verify methods don't crash on missing tags.

    Patch file attached: 0001-Fix-Make-SurfaceMountingManager-methods-soft-instead.patch

  4. react-native-bot commented on Nov 7, 2026

    @react-native-bot
    Collaborator

    This issue is waiting for author's feedback since 24 days. Please provide the requested feedback or this will be closed in 7 days.

  5. added
    Stale
    on Nov 7, 2026
  6. react-native-bot commented on Nov 14, 2026

    @react-native-bot
    Collaborator

    This issue was closed because it has been stalled for 7 days with no activity.

  7. react-native-bot commented on Nov 14, 2026

    @react-native-bot
    Collaborator

    This issue was closed because the author hasn't provided the requested feedback after 7 days.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Needs: Author FeedbackNeeds: ReproPlatform: AndroidStale

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions