Skip to content

[Android + React Native 0.82] reloadReactNative crash #4895

@Julienlecloset

Description

@Julienlecloset

Did you test using the latest Detox?

  • I have tested this issue on the latest Detox release and it still reproduces.

Did your test fail and you're not sure why?

  • I have read the troubleshooting guide and it didn't help me.

What happened?

On Android, since React Native 0.82, device.reloadReactNative() results in the app crashing.
No issue whatsoever on iOs nor on Android with React Native 0.81.5.

The error I have is java.lang.RuntimeException: You should not use ReactNativeHost directly in the New Architecture and indeed ReactNativeHost was removed from React Native 0.82 : https://react-native-community.github.io/upgrade-helper/?from=0.81.5&to=0.82.1

Should I just stop using reloadReactNative or is this something that could be fixed?

What was the expected behaviour?

The app should reload and no crash should happen.

Help us reproduce this issue!

Just call device.reloadReactNative on an app with React Native 0.82.1 on Android.

In what environment did this happen?

Detox version: 20.46.3
React Native version: 0.82.1
Has Fabric (React Native's new rendering system) enabled: yes
Node version: 22
Device model: Emulator with Pixel 8 Pro
Android version: 15.0
Test-runner (select one): jest

Detox logs

Detox logs
paste logs here!

Device logs

Device logs
paste your device.log here!

More data, please!

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions