question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Android + React Native 0.68.1]The app has not responded to the network requests

See original GitHub issue

What happened?

got an error with android for react native 0.68.1, works fine for ios.

error:

15:31:02.641 detox[62277] WARN:  [PENDING_REQUESTS] The app has not responded to the network requests below:
  (id = -1000) isReady: {}

Unresponded network requests might result in timeout errors in Detox tests.

i have added

android:networkSecurityConfig="@xml/network_security_config"

to both android/app/src/debug/AndroidManifest.xml and android/app/src/main/AndroidManifest.xml

What was the expected behaviour?

should work on android

Was it tested on latest Detox?

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

Did your test throw out a timeout?

Help us reproduce this issue!

No response

In what environment did this happen?

Detox version: 19.6.5 React Native version: 0.68.1 Node version: v14.17.0 Device model: Pixel_5_API_30 Android version: Test-runner (select one): jest-circus

Detox logs

Detox logs
15:30:57.533 detox[62277] DEBUG: [WSS_CONNECTION, #53194] registered a new connection.
15:30:57.542 detox[62277] TRACE: [WSS_GET_FROM, #53194] {"messageId":0,"type":"login","params":{"role":"app","sessionId":"55850b8f-d1a3-3104-efba-036e1214da4c"}}
15:30:57.542 detox[62277] TRACE: [WSS_SEND_TO, #app] {"messageId":0,"type":"loginSuccess","params":{"testerConnected":true,"appConnected":true}}
15:30:57.543 detox[62277] TRACE: [SESSION_JOINED] app joined session 55850b8f-d1a3-3104-efba-036e1214da4c
15:30:57.543 detox[62277] TRACE: [WSS_SEND_TO, #tester] {"type":"appConnected"}
15:30:57.543 detox[62277] TRACE: [WS_MESSAGE] {"type":"appConnected"}
 
15:30:57.545 detox[62277] TRACE: [WS_SEND] {"type":"isReady","params":{},"messageId":-1000}
15:30:57.546 detox[62277] TRACE: [WSS_GET_FROM, #tester] {"type":"isReady","params":{},"messageId":-1000}
15:30:57.546 detox[62277] TRACE: [WSS_SEND_TO, #app] {"type":"isReady","params":{},"messageId":-1000}
15:30:57.566 detox[62277] TRACE: [WSS_GET_FROM, #app] {"messageId":-10000,"type":"AppWillTerminateWithError","params":{"errorDetails":"@Thread detox.primary(1165):\njava.lang.NoSuchMethodError: No virtual method addReactInstanceEventListener(Lcom\/facebook\/react\/ReactInstanceManager$ReactInstanceEventListener;)V in class Lcom\/facebook\/react\/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in \/data\/app\/~~a9qlgwC0hyyk5n3hNs2jZg==\/com.mobile-PUIoda_qVyncxT3L73YzUA==\/base.apk)\n\tat com.wix.detox.reactnative.ReactNativeLoadingMonitor$subscribeToNewRNContextUpdates$1.run(ReactNativeLoadingMonitor.kt:38)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2223)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loop(Looper.java:223)\n\tat android.app.ActivityThread.main(ActivityThread.java:7656)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)\n\nCheck device logs for full details!"}}
15:30:57.566 detox[62277] TRACE: [WSS_SEND_TO, #tester] {"messageId":-10000,"type":"AppWillTerminateWithError","params":{"errorDetails":"@Thread detox.primary(1165):\njava.lang.NoSuchMethodError: No virtual method addReactInstanceEventListener(Lcom/facebook/react/ReactInstanceManager$ReactInstanceEventListener;)V in class Lcom/facebook/react/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in /data/app/~~a9qlgwC0hyyk5n3hNs2jZg==/com.mobile-PUIoda_qVyncxT3L73YzUA==/base.apk)\n\tat com.wix.detox.reactnative.ReactNativeLoadingMonitor$subscribeToNewRNContextUpdates$1.run(ReactNativeLoadingMonitor.kt:38)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2223)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loop(Looper.java:223)\n\tat android.app.ActivityThread.main(ActivityThread.java:7656)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)\n\nCheck device logs for full details!"}}
15:30:57.585 detox[62277] TRACE: [WS_MESSAGE] {"messageId":-10000,"type":"AppWillTerminateWithError","params":{"errorDetails":"@Thread detox.primary(1165):\njava.lang.NoSuchMethodError: No virtual method addReactInstanceEventListener(Lcom/facebook/react/ReactInstanceManager$ReactInstanceEventListener;)V in class Lcom/facebook/react/ReactInstanceManager; or its super classes (declaration of 'com.facebook.react.ReactInstanceManager' appears in /data/app/~~a9qlgwC0hyyk5n3hNs2jZg==/com.mobile-PUIoda_qVyncxT3L73YzUA==/base.apk)\n\tat com.wix.detox.reactnative.ReactNativeLoadingMonitor$subscribeToNewRNContextUpdates$1.run(ReactNativeLoadingMonitor.kt:38)\n\tat java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:462)\n\tat java.util.concurrent.FutureTask.run(FutureTask.java:266)\n\tat android.app.Instrumentation$SyncRunnable.run(Instrumentation.java:2223)\n\tat android.os.Handler.handleCallback(Handler.java:938)\n\tat android.os.Handler.dispatchMessage(Handler.java:99)\n\tat android.os.Looper.loop(Looper.java:223)\n\tat android.app.ActivityThread.main(ActivityThread.java:7656)\n\tat java.lang.reflect.Method.invoke(Native Method)\n\tat com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)\n\tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)\n\nCheck device logs for full details!"}}
 
15:31:02.592 detox[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-5554', bundleId: 'com.mobile' })
15:31:02.595 detox[62312] TRACE: [SPAWN_KILL] sending SIGINT to: /Users/emilyxiong/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:53096 -e detoxSessionId 55850b8f-d1a3-3104-efba-036e1214da4c -e debug false com.mobile.test/androidx.test.runner.AndroidJUnitRunner
15:31:02.597 detox[62277] DEBUG: [SPAWN_END, #27, cpid=62312] /Users/emilyxiong/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:53096 -e detoxSessionId 55850b8f-d1a3-3104-efba-036e1214da4c -e debug false com.mobile.test/androidx.test.runner.AndroidJUnitRunner terminated with SIGINT
15:31:02.598 detox[62277] DEBUG: [EXEC_CMD, #29] "/Users/emilyxiong/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "am force-stop com.mobile"
15:31:02.604 detox[62277] DEBUG: [EXEC_CMD, #30] "/Users/emilyxiong/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse --remove tcp:53096
15:31:02.611 detox[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onHookFailure({
  error: DetoxRuntimeError: Failed to run application on the device
  
  HINT: Most likely, your tests have timed out and called detox.cleanup() while it was waiting for "ready" message (over WebSocket) from the instrumentation process.
      at /Users/emilyxiong/Code/tmp/nx-react-native-68-1/apps/mobile-e2e/test-setup.ts:4:16
      at Promise.then.completed (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/utils.js:390:28)
      at new Promise (<anonymous>)
      at callAsyncCircusFn (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/utils.js:315:10)
      at _callCircusHook (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/run.js:181:40)
      at processTicksAndRejections (internal/process/task_queues.js:95:5)
      at _runTestsForDescribeBlock (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/run.js:47:7)
      at run (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/run.js:25:3)
      at runAndTransformResultsToJestFormat (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:167:21)
      at jestAdapter (/Users/emilyxiong/Code/tmp/nx-react-native-68-1/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:82:19)
      at runTestInternal (/Users/emilyxiong/.nvm/versions/node/v14.17.0/lib/node_modules/jest/node_modules/jest-runner/build/runTest.js:389:16)
      at runTest (/Users/emilyxiong/.nvm/versions/node/v14.17.0/lib/node_modules/jest/node_modules/jest-runner/build/runTest.js:481:34)
      at TestRunner.runTests (/Users/emilyxiong/.nvm/versions/node/v14.17.0/lib/node_modules/jest/node_modules/jest-runner/build/index.js:111:12)
      at TestScheduler.scheduleTests (/Users/emilyxiong/.nvm/versions/node/v14.17.0/lib/node_modules/jest/node_modules/@jest/core/build/TestScheduler.js:333:13),
  hook: 'beforeAll'
})
15:31:02.613 Mobile[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'Mobile' })
15:31:02.614 detox[62277] INFO:  Mobile is assigned to emulator-5554 (Pixel_5_API_30)
15:31:02.615 detox[62277] INFO:  Mobile: should display welcome message
15:31:02.617 detox[62277] INFO:  Mobile: should display welcome message [FAIL]
15:31:02.619 Mobile[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'Mobile' })

15:31:02.619 ROOT_DESCRIBE_BLOCK[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' })
15:31:02.640 detox[62277] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeCleanup()
15:31:02.641 detox[62277] WARN:  [PENDING_REQUESTS] The app has not responded to the network requests below:
  (id = -1000) isReady: {}

Unresponded network requests might result in timeout errors in Detox tests.

15:31:02.644 detox[62277] TRACE: [EXEC_SUCCESS, #30] 
15:31:02.649 detox[62277] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully

Device logs

Device logs
paste logs here!

More data, please!

No response

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:2
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
hajermaycommented, Apr 25, 2022

@medbenmoussa i used the react-native 0.67 instead and it works I think the problem is with the last react native version

0reactions
d4vidicommented, Apr 25, 2022

Looks like we have an issue with RN .68 (integs. of Detox with new RN releases are often not trivial). Please track #3344

Read more comments on GitHub >

github_iconTop Results From Across the Web

Detox + Jest - App has not responded to the network requests ...
I am currently setting up Detox for an existing project and running into snags. I am using Detox + Jest and am receiving...
Read more >
The app has not responded to the network requests below
Hi I have received below error when I run the Android Emulator with Detox in Bitrise. 08:30:42.529 detox[4685] WARN: [PENDING_REQUESTS] The ...
Read more >
Networking - React Native
Networking. Many mobile apps need to load resources from a remote URL. You may want to make a POST request to a REST...
Read more >
React Native (@reactnative) / Twitter
Our team has been working on an experimental cross-platform pointer API for React Native this past year and we're excited to share our...
Read more >
React Native - Localytics Documentation
The Localytics SDK was last verified against version 0.68.5. ... For apps on React Native version 0.60.x and above, it is highly suggested...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found