wix / Detox

Gray box end-to-end testing and automation framework for mobile apps
https://wix.github.io/Detox/
MIT License
11.01k stars 1.9k forks source link

No static field REACT_BRIDGE_LOADING_START of type Lcom/facebook/react/bridge/ReactMarkerConstants #4445

Closed Rolando-Barbella closed 1 month ago

Rolando-Barbella commented 1 month ago

What happened?

After successfully doing all the setup, I want to run my first, when I do detox test --configuration android.emu.debug, I get the following error:

 @Thread main(2):
    java.lang.NoSuchFieldError: No static field REACT_BRIDGE_LOADING_START of type Lcom/facebook/react/bridge/ReactMarkerConstants; in class Lcom/facebook/react/bridge/ReactMarkerConstants; or its superclasses (declaration of 'com.facebook.react.bridge.ReactMarkerConstants'

I have found little information about this type of error, I have doubled checked the whole setup instruction but still

My react native vs is a bit old unfortunately: 0.63.2 I also have: androidTestImplementation('com.wix:detox-legacy:+') on my app/build.gradle

What was the expected behaviour?

No response

Was it tested on latest Detox?

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: ^20.19.4 React Native version: : 0.63.2 Has Fabric (React Native's new rendering system) enabled: (yes/no) Node version: 16.14.0 Device model: Pixel_3a_API_31_arm64-v8a Android version: Test-runner (select one): jest

Detox logs

Detox logs ``` paste logs here! ```

Device logs

Device logs ``` The app has crashed, see the details below: @Thread main(2): java.lang.NoSuchFieldError: No static field REACT_BRIDGE_LOADING_START of type Lcom/facebook/react/bridge/ReactMarkerConstants; in class Lcom/facebook/react/bridge/ReactMarkerConstants; or its superclasses (declaration of 'com.facebook.react.bridge.ReactMarkerConstants' appears in /data/app/~~7xSG0zETQAWbbbbcV7dYzw==/com.osapiens.operations.cona.tnr-b7e5AMXH7v6iCZzqF53AcQ==/base.apk) at com.wix.detox.reactnative.ReactMarkersLogger.logMarker(ReactMarkersLogger.kt:20) at com.facebook.react.bridge.ReactMarker.logMarker(ReactMarker.java:137) at com.facebook.react.bridge.ReactMarker.logMarker(ReactMarker.java:130) at com.facebook.react.devsupport.DevSupportManagerBase.handleReloadJS(DevSupportManagerBase.java:817) at com.facebook.react.ReactInstanceManager$3$1.run(ReactInstanceManager.java:420) 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:7822) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003) Check device logs for full details! 1 | describe('Example', () => { 2 | beforeAll(async () => { > 3 | await device.launchApp({ newInstance: true }); | ^ 4 | }); 5 | 6 | beforeEach(async () => { at launchApp (e2e/log-in.test.js:3:18) at tryCatch (node_modules/regenerator-runtime/runtime.js:64:40) at Generator.invoke (node_modules/regenerator-runtime/runtime.js:299:22) at Generator.next (node_modules/regenerator-runtime/runtime.js:124:21) at tryCatch (node_modules/regenerator-runtime/runtime.js:64:40) at invoke (node_modules/regenerator-runtime/runtime.js:160:20) ```

More data, please!

No response

d4vidi commented 1 month ago

Hey @Rolando-Barbella Unfortunately, technically we only support React Native versions ≥ 0.71.0. Nevertheless, I could accept a PR that limits Detox's ReactMarkersLogger so it'd only kick into action for the supported versions (i.e. minor ≥ 71). Should be pretty simple to implement.

Rolando-Barbella commented 1 month ago

Hey @d4vidi thanks for the support, just did a PR as you suggested, let me know if you have any comments

Rolando-Barbella commented 1 month ago

Hi @d4vidi, if I manually add the change we merged related to this topic in my local ( just to test ), still doesn't work unfortunately, you sure the ReacMakersLogger is the one that can handle this?

The steps I follow:

d4vidi commented 1 month ago

@Rolando-Barbella try again with Detox 20.20.3 and see whether the issue is resolved