Skip to content

[Android] App crashes on hot reload with New Architecture (Fabric + Bridgeless) #3476

@kimchi-developer

Description

@kimchi-developer

Description

App crashes with SIGABRT when pressing r for hot reload in development mode on Android with New Architecture enabled.

What happened

When hot reloading, the app crashes immediately with a JNI null pointer error.

What I expected

Hot reload should work without crashing.

Environment

  • react-native: 0.83.0-rc.3 / 0.83.0-rc.5
  • react-native-screens: 4.19.0-nightly-20251203
  • Architecture: New Architecture (Fabric + Bridgeless)
  • Platform: Android

Reproduction

  1. Create any app with @react-navigation/native-stack
  2. Enable New Architecture on Android
  3. Run the app in development mode
  4. Press r to hot reload
  5. App crashes

Crash Log

F libc: Fatal signal 6 (SIGABRT), code -1 (SI_QUEUE)
JNI DETECTED ERROR IN APPLICATION: field operation on NULL object: 0x0
  in call to GetObjectField
  from void com.facebook.jni.HybridData$Destructor.deleteNative(long)

Stack Trace

#16 facebook::react::JFabricUIManager::getBinding()
#17 facebook::react::RNSScreenShadowNodeCommitHook::getUIManagerFromSharedContext
#18 facebook::react::RNSScreenShadowNodeCommitHook::~RNSScreenShadowNodeCommitHook

Root Cause

The bug was introduced in PR #3295 (commit 91b17d5).

The RNSScreenShadowNodeCommitHook destructor tries to call getUIManagerFromSharedContext() to unregister itself, but during hot reload, FabricUIManagerBinding is already destroyed, causing a null pointer access.

Suggested Fix

Don't unregister in the destructor since UIManager cleans up hooks automatically when destroyed.

I have a PR ready: #3475

Metadata

Metadata

Assignees

No one assigned

    Labels

    Missing infoThe user didn't precise the problem enoughMissing reproThis issue need minimum repro scenarioPlatform: AndroidThis issue is specific to Android

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions