I am trying to test an android app for a react-native project using detox. When running the app on a device or a simulator outside of detox, everything works.
After generating the detox build, when I run the detox test command, the app is successfully installed and opened on the simulator. When device.reloadReactNative
is called via beforeEach
within the tests, the app crashes with the error described below.
I put the test file and the corresponding verbose adb logcat output in a gist here.
For whatever reason the AppRegistry.js is not being loaded, otherwise the module should be known (see Error).
To wrap it up:
reloadReactNative
is called. Why?detox test --configuration android.emu.release --cleanup -l verbose
INSTRUMENTATION_RESULT: longMsg=com.facebook.react.common.JavascriptException: Module AppRegistry is not a registered callable module (calling runApplication)
Thrown here because AppRegistry
has not been registered to the MessageQueue's module list.
Detox has compatibility issues with React Native Navigation v1. This will probably never be solved since Wix has already deprecated v1 in favour of v2.
You can either migrate to v2 or use the v1➜v2 adapter. Detox has been tested on React Native Navigation v2, in fact, RNNv2 e2e test suites are using Detox on both platforms.