-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Launch on Android fails - DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action #908
Comments
the same @leugimmai :( |
same problem here 😢 . |
I'll take a look in the next few days, so basically you are telling that the combination of Windows 10 + hardware device + debug mode does not work on detox. I'll check that too and get back to you. Also, could you bump your detox version to 9? Anyway AFAIR the 8th version does not support RN 0.55 on Android. |
@leugimmai, could you submit crash details from |
@noomorph I have the same problem. Here is the crash detail from
|
@noomorph Do you have any update on this ? |
@AntoineGrandchamp, thanks for submitting crash details. I believe that currently, the right person to contact will be @rotemmiz. He's most familiar with this part, though even now I can say that he will ask for more details. E.g. what kind of app do you have? Is it a greenfield or brownfield app? When do you load React Native? Maybe you should get into Java debugger and see why it does not get a new reactContext... since anyway we don't have a public repository that reproduces your problem. |
Clarification. At the moment, the reason why this issue got a label |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
Still the same problem React: 16.6.1 detox[43836] DEBUG: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=962944a2-143c-c6b1-c098-11d265255bae) const ws = _.get(this.sessions, [sessionId, otherRole]); getting undefined. |
I got the same issue with API 18 on Android: Detox: 9.0.1 It's working on API 19, not 18 ! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
I had the same problem with real devices, but I had no problem with emulators. |
Hi, Just curious, is your packager server running in bg? When I run detox test, it does not launch the packager server and my app crashes, but when I launch the server, my tests execute properly. |
Same here Detox: 9.1.2 Here is the crash detail from
It seems there is an issue with getting the current ReactContext |
@leugimmai @lvmtam @ZSeba @AntoineGrandchamp @selvakumardreams @rawqing |
@rotemmiz - I've found the exact reason - react native navigation. As for Detox we have I'm playing with ReactNativeSupport.java, and trying to replace the interfaces, but to no avail. |
RNN uses Detox for its E2E suite, It is supported from the very beginning. |
@rotemmiz - that was helpful, I've played with RNN test app. Is there a way to run Detox on app with redux? |
Detox does not understand JavaScript at all, it only monitors threads, native modules and native UI hierarchy. Redux has nothing to do with it. |
@rotemmiz you are absolutely right. I've managed to run the detox for android via fix in MainApplication.java I know it is not relevant for detox, yet I'll share it here, so anyone with similar issue could save some time Make sure you Override the getReactNativeHost() with the host you've created
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
The issue has been closed for inactivity. |
Description
Currently as it stands my app builds fine and launches like normal when running
react-native run-android
. It is when I try to run the detox test is that things fail. The app will launch on my device shortly there after it just hangs and eventually crashes. I did the initial set up with android, and ran the detox-cli to add the e2e folder with tests as well.Steps to Reproduce
Running:
detox test -c debug
Detox, Node, Device, Xcode and macOS Versions
Device and verbose Detox logs
package.json:
{ "name": "example", "version": "0.1.0", "private": true, "devDependencies": { "babel-preset-react-native-stage-0": "1.0.1", "jest": "22.4.3", "jest-react-native": "18.0.0", "react-test-renderer": "16.3.0-alpha.1" }, "scripts": { "start": "react-native start", "android": "react-native run-android", "ios": "react-native run-ios", "test": "jest" }, "jest": { "preset": "react-native" }, "dependencies": { "detox": "^8.2.3", "mobx": "4.3.0", "mobx-react": "5.1.2", "react": "16.4.1", "react-native": "0.55", "react-native-action-button": "2.8.4", "react-native-background-fetch": "2.4.3", "react-native-battery": "^0.1.15", "react-native-camera": "1.1.0", "react-native-device-info": "0.21.5", "react-native-dialog": "^5.1.0", "react-native-dropdownalert": "3.5.0", "react-native-elements": "0.19.1", "react-native-exception-handler": "https://[email protected]/samrenick/react-native-exception-handler.git", "react-native-geocoder": "0.5.0", "react-native-geolocation-service": "^1.1.0", "react-native-maps": "http://[email protected]/miguelquintana/react-native-maps.git", "react-native-navigation-actions": "1.0.4", "react-native-numeric-input": "1.3.1", "react-native-popup-menu": "0.13.2", "react-native-signature-capture": "https://[email protected]/cxrd/react-native-signature-capture.git", "react-native-simple-toast": "^0.0.8", "react-native-sound": "0.10.9", "react-native-sqlite-storage": "^3.3.6", "react-native-vector-icons": "4.6.0", "react-navigation": "2.6.2" }, "detox": { "configurations": { "debug": { "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk", "build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..", "type": "android.attached", "name": "FA79E1A07174" }, "release": { "binaryPath": "android/app/build/outputs/apk/release/app-release.apk", "build": "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..", "type": "android.attached", "name": "FA79E1A07174" } }, "test-runner": "jest" } }
detox log:
`configuration="debug" loglevel="verbose" artifactsLocation="artifacts\debug.2018-08-29 20-37-01Z" node_modules.bin\jest e2e --config=e2e/config.json --maxWorkers=1 "--testNamePattern=^((?!:ios:).)$"
detox[67084] INFO: [DetoxServer.js] server listening on localhost:54130...
detox[67084] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:54130
detox[67084] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48
detox[67084] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48
detox[67084] DEBUG: [exec.js/EXEC_CMD, #0] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb devices
detox[67084] DEBUG: [exec.js/EXEC_CMD, #1] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell dumpsys power | findstr /R /C:"^[ ]m[UW].="
detox[67084] DEBUG: [exec.js/EXEC_CMD, #2] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\build-tools\28.0.0\aapt dump badging "C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\debug\app-debug.apk" | findstr /C:"package: name="
detox[67084] DEBUG: [exec.js/EXEC_CMD, #3] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 uninstall com.atether
detox[67084] DEBUG: [exec.js/EXEC_CMD, #4] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 uninstall com.atether.test
detox[67084] DEBUG: [exec.js/EXEC_CMD, #5] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell getprop ro.build.version.sdk
detox[67084] DEBUG: [exec.js/EXEC_CMD, #6] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 install -r -g C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\debug\app-debug.apk
detox[67084] DEBUG: [exec.js/EXEC_CMD, #7] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell getprop ro.build.version.sdk
detox[67084] DEBUG: [exec.js/EXEC_CMD, #8] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 install -r -g C:\Users\miguel.quintana\Development\atether\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk
detox[67084] DEBUG: [exec.js/EXEC_CMD, #9] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell am force-stop com.atether
detox[67084] DEBUG: [exec.js/EXEC_CMD, #10] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell pm list instrumentation
detox[67084] DEBUG: [exec.js/SPAWN_CMD, #11] [pid=26888] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell am instrument -w -r "-e detoxServer ws://localhost:54130 -e detoxSessionId c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48" -e debug false com.atether.test/android.support.test.runner.AndroidJUnitRunner
detox[67084] DEBUG: [exec.js/EXEC_CMD, #12] C:\Users\miguel.quintana\AppData\Local\Android\Sdk\platform-tools\adb -s FA79E1A07174 shell ps | findstr /R /C:"com.atether[ ]$"
detox[67084] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=c6ce6acb-85c4-87c1-84b1-9ebedcf6cc48)
detox[44968] ERROR: [AsyncWebSocket.js/WEBSOCKET_ERROR] caught error: Error: connect ECONNREFUSED 127.0.0.1:55301
err: Error: connect ECONNREFUSED 127.0.0.1:55301
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
detox[44968] ERROR: [index.js/DETOX_INIT_ERROR]
{ Error: connect ECONNREFUSED 127.0.0.1:55301
at Object._errnoException (util.js:992:11)
at _exceptionWithHostPort (util.js:1014:20)
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
code: 'ECONNREFUSED',
errno: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 55301,
type: 'error',
target:
WebSocket {
domain: null,
_events: { error: [Function: onerror] },
_eventsCount: 1,
_maxListeners: undefined,
_socket: null,
_ultron: null,
_closeReceived: false,
bytesReceived: 0,
readyState: 3,
supports: { binary: true },
extensions: null,
_binaryType: 'nodebuffer',
_isServer: false,
url: 'ws://localhost:55301',
protocolVersion: 13,
_closeTimer: null,
_closeCode: 1006 } }
(node:44968) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'addExpectationResult' of undefined
(node:44968) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
(node:44968) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
child_process.js:644
throw err;
^
Error: Command failed: node_modules.bin\jest e2e --config=e2e/config.json --maxWorkers=1 "--testNamePattern=^((?!:ios:).)*$"
at checkExecSyncError (child_process.js:601:13)
at Object.execSync (child_process.js:641:13)
at runJest (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:154:6)
at run (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:85:7)
at Object. (C:\Users\miguel.quintana\Development\atether\node_modules\detox\local-cli\detox-test.js:217:1)
at Module._compile (module.js:652:30)
at Object.Module._extensions..js (module.js:663:10)
at Module.load (module.js:565:32)
at tryModuleLoad (module.js:505:12)
at Function.Module._load (module.js:497:3)`
The text was updated successfully, but these errors were encountered: