Detox 14.6.1 with RN 0.61.3 with Android fails to connect with the Metro Bundler

Created on 7 Nov 2019  ยท  36Comments  ยท  Source: wix/Detox

After upgrading a React Native application to 0.61.3, Android detox testing stopped working and would just hang. There is also no debug connection messages displayed on the Metro bundler.

Here is the trace output from Android:

$ detox test -c android.emu.debug --loglevel trace e2e/base/welcome.spec.js
detox[10230] INFO:  [test.js] configuration="android.emu.debug" loglevel="trace" artifactsLocation="artifacts/android.emu.debug.2019-11-07 17-07-55Z" recordLogs="none" takeScreenshots="manual" recordVideos="none" recordPerformance="none" reportSpecs=true readOnlyEmu=false node_modules/.bin/jest --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:ios:).)*$' e2e/base/welcome.spec.js
โ— Deprecation Warning:

  Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.

  Please update your configuration.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

detox[10231] INFO:  [DetoxServer.js] server listening on localhost:64180...
detox[10231] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:64180
detox[10231] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"0bf02aa4-e3cd-4114-e942-fb67509f7eba","role":"tester"},"messageId":0}
detox[10231] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=0bf02aa4-e3cd-4114-e942-fb67509f7eba
detox[10231] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=0bf02aa4-e3cd-4114-e942-fb67509f7eba
detox[10231] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"0bf02aa4-e3cd-4114-e942-fb67509f7eba","role":"tester"},"messageId":0}

detox[10231] DEBUG: [exec.js/EXEC_CMD, #0] /Users/user/Library/Android/sdk/emulator/emulator -list-avds --verbose
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #0] Pixel_2_API_29

detox[10231] DEBUG: [exec.js/EXEC_CMD, #1] /Users/user/Library/Android/sdk/platform-tools/adb  devices
detox[10231] DEBUG: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-18444  device


detox[10231] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 18444, host: localhost
detox[10231] DEBUG: [exec.js/EXEC_CMD, #2] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "getprop dev.bootcomplete"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #2] 1

detox[10231] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-18444' })
detox[10231] DEBUG: [exec.js/EXEC_CMD, #3] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "getprop ro.build.version.sdk"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #3] 29

detox[10231] DEBUG: [exec.js/EXEC_CMD, #4] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #4]   mWakefulness=Awake
  mWakefulnessChanging=false
  mWakeLockSummary=0x1
  mUserActivitySummary=0x1
  mWakeUpWhenPluggedOrUnpluggedConfig=false
  mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
  mUserActivityTimeoutOverrideFromWindowManager=-1
  mUserInactiveOverrideFromWindowManager=false

detox[10231] DEBUG: [exec.js/EXEC_CMD, #5] /Users/user/Library/Android/sdk/build-tools/29.0.2/aapt dump badging "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/debug/app-debug.apk" | grep -e "package: name="
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='com.heresmyinfo.client.debug' versionCode='44' versionName='0.9.72' compileSdkVersion='28' compileSdkVersionCodename='9'

detox[10231] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: 'emulator-18444',
  bundleId: 'com.heresmyinfo.client.debug' })
detox[10231] DEBUG: [exec.js/EXEC_CMD, #6] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "pm list packages com.heresmyinfo.client.debug"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #6] package:com.heresmyinfo.client.debug.test
package:com.heresmyinfo.client.debug

detox[10231] DEBUG: [exec.js/EXEC_CMD, #7] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 uninstall com.heresmyinfo.client.debug
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #7] Success

detox[10231] DEBUG: [exec.js/EXEC_CMD, #8] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "pm list packages com.heresmyinfo.client.debug.test"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #8] package:com.heresmyinfo.client.debug.test

detox[10231] DEBUG: [exec.js/EXEC_CMD, #9] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 uninstall com.heresmyinfo.client.debug.test
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #9] Success

detox[10231] DEBUG: [exec.js/EXEC_CMD, #10] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 install -r -g -t "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/debug/app-debug.apk"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #10] Performing Streamed Install
Success

detox[10231] DEBUG: [exec.js/EXEC_CMD, #11] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 install -r -g -t "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #11] Performing Streamed Install
Success

detox[10231] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-18444',
  bundleId: 'com.heresmyinfo.client.debug' })
detox[10231] DEBUG: [exec.js/EXEC_CMD, #12] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "am force-stop com.heresmyinfo.client.debug"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #12]
detox[10231] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-18444',
  bundleId: 'com.heresmyinfo.client.debug',
  launchArgs:
   { detoxServer: 'ws://localhost:64180',
     detoxSessionId: '0bf02aa4-e3cd-4114-e942-fb67509f7eba' } })
detox[10231] DEBUG: [exec.js/EXEC_CMD, #13] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "date +\"%m-%d %T.000\""
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #13] 11-07 09:07:58.000

detox[10231] DEBUG: [exec.js/EXEC_CMD, #14] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 reverse tcp:64180 tcp:64180
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #14] 64180

detox[10231] DEBUG: [exec.js/EXEC_CMD, #15] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "pm list instrumentation"
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #15] instrumentation:com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner (target=com.heresmyinfo.client.debug)

detox[10231] DEBUG: [exec.js/SPAWN_CMD, #16] [pid=10252] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell am instrument -w -r -e detoxServer ws://localhost:64180 -e detoxSessionId 0bf02aa4-e3cd-4114-e942-fb67509f7eba -e debug ZmFsc2U= com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner
detox[10231] DEBUG: [exec.js/EXEC_CMD, #17] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-18444 shell "ps | grep \"com\.heresmyinfo\.client\.debug$\""
detox[10231] TRACE: [exec.js/EXEC_SUCCESS, #17] u0_a147       4370  1776 1905620 129332 0                   0 R com.heresmyinfo.client.debug

detox[4370] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-18444',
  bundleId: 'com.heresmyinfo.client.debug',
  launchArgs:
   { detoxServer: 'ws://localhost:64180',
     detoxSessionId: '0bf02aa4-e3cd-4114-e942-fb67509f7eba' },
  pid: 4370 })
detox[10231] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[10231] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=0bf02aa4-e3cd-4114-e942-fb67509f7eba)
detox[10231] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=0bf02aa4-e3cd-4114-e942-fb67509f7eba)

 RUNS  e2e/base/welcome.spec.js 

It hangs after the 'cannot fw action' debug statement without connecting to the application on the emulator and there

While ios also issues a 'cannot fw action' debug statement, it continues processing to connect to the application on the emulator.

$ detox test -c ios.sim.debug --loglevel trace e2e/base/welcome.spec.js
detox[10033] INFO:  [test.js] configuration="ios.sim.debug" loglevel="trace" artifactsLocation="artifacts/ios.sim.debug.2019-11-07 16-54-40Z" recordLogs="none" takeScreenshots="manual" recordVideos="none" recordPerformance="none" reportSpecs=true node_modules/.bin/jest --config=e2e/config.json --maxWorkers=1 '--testNamePattern=^((?!:android:).)*$' e2e/base/welcome.spec.js
โ— Deprecation Warning:

  Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.

  Please update your configuration.

  Configuration Documentation:
  https://jestjs.io/docs/configuration.html

detox[10034] INFO:  [DetoxServer.js] server listening on localhost:59142...
detox[10034] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:59142
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde","role":"tester"},"messageId":0}
detox[10034] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde","role":"tester"},"messageId":0}

detox[10034] DEBUG: [exec.js/EXEC_CMD, #0] applesimutils --list --byType "iPhone 8"
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #0] [
  {
    "deviceType" : {
      "name" : "iPhone 8",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 8.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8"
    },
    "state" : "Booted",
    "isAvailable" : true,
    "name" : "iPhone 8",
    "udid" : "3AD1ADD0-599B-400A-A018-9497928A95A7",
    "os" : {
      "buildversion" : "17A844",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime",
      "isAvailable" : true,
      "name" : "iOS 13.1",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-13-1",
      "version" : "13.1"
    }
  }
]

detox[10034] DEBUG: [exec.js/EXEC_CMD, #1] applesimutils --list --byId 3AD1ADD0-599B-400A-A018-9497928A95A7 --maxResults 1
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #1] [
  {
    "deviceType" : {
      "name" : "iPhone 8",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/DeviceTypes\/iPhone 8.simdevicetype",
      "identifier" : "com.apple.CoreSimulator.SimDeviceType.iPhone-8"
    },
    "state" : "Booted",
    "isAvailable" : true,
    "name" : "iPhone 8",
    "udid" : "3AD1ADD0-599B-400A-A018-9497928A95A7",
    "os" : {
      "buildversion" : "17A844",
      "bundlePath" : "\/Applications\/Xcode.app\/Contents\/Developer\/Platforms\/iPhoneOS.platform\/Library\/Developer\/CoreSimulator\/Profiles\/Runtimes\/iOS.simruntime",
      "isAvailable" : true,
      "name" : "iOS 13.1",
      "identifier" : "com.apple.CoreSimulator.SimRuntime.iOS-13-1",
      "version" : "13.1"
    }
  }
]

detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false,
  deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7' })
detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  bundleId: 'com.heresmyinfo.heresmyinfo' })
detox[10034] DEBUG: [exec.js/EXEC_CMD, #2] /usr/bin/xcrun simctl uninstall 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo
detox[10034] DEBUG: [exec.js/EXEC_TRY, #2] Uninstalling com.heresmyinfo.heresmyinfo...
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #2]
detox[10034] DEBUG: [exec.js/EXEC_SUCCESS, #2] com.heresmyinfo.heresmyinfo uninstalled
detox[10034] DEBUG: [exec.js/EXEC_CMD, #3] /usr/bin/xcrun simctl install 3AD1ADD0-599B-400A-A018-9497928A95A7 "/Users/user/work/myInfo/Client/ios/build/Build/Products/Debug-iphonesimulator/client.app"
detox[10034] DEBUG: [exec.js/EXEC_TRY, #3] Installing /Users/user/work/myInfo/Client/ios/build/Build/Products/Debug-iphonesimulator/client.app...
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #3]
detox[10034] DEBUG: [exec.js/EXEC_SUCCESS, #3] /Users/user/work/myInfo/Client/ios/build/Build/Products/Debug-iphonesimulator/client.app installed
detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  bundleId: 'com.heresmyinfo.heresmyinfo' })
detox[10034] DEBUG: [exec.js/EXEC_CMD, #4] /usr/bin/xcrun simctl terminate 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo
detox[10034] DEBUG: [exec.js/EXEC_TRY, #4] Terminating com.heresmyinfo.heresmyinfo...
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #4]
detox[10034] DEBUG: [exec.js/EXEC_SUCCESS, #4] com.heresmyinfo.heresmyinfo terminated
detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ bundleId: 'com.heresmyinfo.heresmyinfo',
  deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  launchArgs:
   { detoxServer: 'ws://localhost:59142',
     detoxSessionId: '70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde' } })
detox[10034] DEBUG: [exec.js/EXEC_CMD, #5] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/user/Library/Detox/ios/6c3d88685b110179f322e5aa846acc3a7725e287/Detox.framework/Detox" /usr/bin/xcrun simctl launch 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo --args -detoxServer "ws://localhost:59142" -detoxSessionId "70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde"
detox[10034] DEBUG: [exec.js/EXEC_TRY, #5] Launching com.heresmyinfo.heresmyinfo...
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #5] com.heresmyinfo.heresmyinfo: 10071

detox[10034] DEBUG: [exec.js/EXEC_CMD, #6] /usr/bin/xcrun simctl get_app_container 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #6] /Users/user/Library/Developer/CoreSimulator/Devices/3AD1ADD0-599B-400A-A018-9497928A95A7/data/Containers/Bundle/Application/6193C385-0FDD-43C9-8135-3FB9D82CDC99/client.app

detox[10034] INFO:  [AppleSimUtils.js] com.heresmyinfo.heresmyinfo launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 3AD1ADD0-599B-400A-A018-9497928A95A7 log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/user/Library/Developer/CoreSimulator/Devices/3AD1ADD0-599B-400A-A018-9497928A95A7/data/Containers/Bundle/Application/6193C385-0FDD-43C9-8135-3FB9D82CDC99/client.app"'
detox[10071] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ bundleId: 'com.heresmyinfo.heresmyinfo',
  deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  launchArgs:
   { detoxServer: 'ws://localhost:59142',
     detoxSessionId: '70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde' },
  pid: 10071 })
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[10034] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] TRACE: [DetoxServer.js/MESSAGE] role=testee action=ready (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"ready","messageId":-1000,"params":{}}

detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"waitForActive","params":{},"messageId":1}
detox[10034] TRACE: [DetoxServer.js/MESSAGE] role=tester action=waitForActive (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] TRACE: [DetoxServer.js/MESSAGE] role=testee action=waitForActiveDone (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"waitForActiveDone","messageId":1,"params":{}}

detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeAll()
detox[10034] TRACE: [Detox.js/DETOX_BEFORE_EACH] running test: "Welcome screen ensure welcome screen elements exist: welcome screen, signup and login"
detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeEach({ title: 'ensure welcome screen elements exist: welcome screen, signup and login',
  fullName: 'Welcome screen ensure welcome screen elements exist: welcome screen, signup and login',
  status: 'running' })
detox[10034] DEBUG: [exec.js/EXEC_CMD, #7] applesimutils --byId 3AD1ADD0-599B-400A-A018-9497928A95A7 --bundle com.heresmyinfo.heresmyinfo --restartSB --setPermissions contacts=YES
detox[10034] DEBUG: [exec.js/EXEC_TRY, #7] Trying to set permissions...
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #7]
detox[10034] DEBUG: [exec.js/EXEC_SUCCESS, #7] Permissions are set
detox[10034] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ bundleId: 'com.heresmyinfo.heresmyinfo',
  deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  launchArgs:
   { detoxServer: 'ws://localhost:59142',
     detoxSessionId: '70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde' } })
detox[10034] DEBUG: [exec.js/EXEC_CMD, #8] SIMCTL_CHILD_DYLD_INSERT_LIBRARIES="/Users/user/Library/Detox/ios/6c3d88685b110179f322e5aa846acc3a7725e287/Detox.framework/Detox" /usr/bin/xcrun simctl launch 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo --args -detoxServer "ws://localhost:59142" -detoxSessionId "70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde"
detox[10034] DEBUG: [exec.js/EXEC_TRY, #8] Launching com.heresmyinfo.heresmyinfo...
detox[10034] DEBUG: [DetoxServer.js/DISCONNECT] role=testee, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"testeeDisconnected","messageId":-49642}

detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #8] com.heresmyinfo.heresmyinfo: 10096

detox[10034] DEBUG: [exec.js/EXEC_CMD, #9] /usr/bin/xcrun simctl get_app_container 3AD1ADD0-599B-400A-A018-9497928A95A7 com.heresmyinfo.heresmyinfo
detox[10034] TRACE: [exec.js/EXEC_SUCCESS, #9] /Users/user/Library/Developer/CoreSimulator/Devices/3AD1ADD0-599B-400A-A018-9497928A95A7/data/Containers/Bundle/Application/6193C385-0FDD-43C9-8135-3FB9D82CDC99/client.app

detox[10034] INFO:  [AppleSimUtils.js] com.heresmyinfo.heresmyinfo launched. To watch simulator logs, run:
        /usr/bin/xcrun simctl spawn 3AD1ADD0-599B-400A-A018-9497928A95A7 log stream --level debug --style compact --predicate 'processImagePath beginsWith "/Users/user/Library/Developer/CoreSimulator/Devices/3AD1ADD0-599B-400A-A018-9497928A95A7/data/Containers/Bundle/Application/6193C385-0FDD-43C9-8135-3FB9D82CDC99/client.app"'
detox[10096] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ bundleId: 'com.heresmyinfo.heresmyinfo',
  deviceId: '3AD1ADD0-599B-400A-A018-9497928A95A7',
  launchArgs:
   { detoxServer: 'ws://localhost:59142',
     detoxSessionId: '70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde' },
  pid: 10096 })
detox[10034] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[10034] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde)
detox[10034] DEBUG: [DetoxServer.js/LOGIN] role=testee, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde
detox[10034] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=testee, sessionId=70cb384d-3f5e-1e41-ad0e-ad6cf58d6cde

 RUNS  e2e/base/welcome.spec.js

I'm also seeing a connection message from the Metro Bundler:

BUNDLE [ios, dev] ./index.js โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“โ–“ 100.0% (1/1), done.

LOG connected to remotedev-server

Environment (please complete the following information):

  • Detox: 14.6.1
  • React Native: 0.61.3
  • Node:
  • Device: Android Pixel 2
  • OS: Mac OSX 10.14.6
triagbug android

All 36 comments

I have the same issue. In an issue on the same topic, people suggested lowering the Android target API down to 27 but that didn't work for me.

Before running detox reverse adb to your android running port

adb reverse tcp:8081 tcp:8081

then run the detox test command

Tried running the 'adb reverse tcp: 8081 tcp: 8081' (where 8081 refers to the Metro Bundler port number) command beforehand and didn't observe any difference. Detox test still isn't connecting to the Metro Bundler.

Also tried lowering the Android target down to 27, but our application requires 28 and lowering it to 27 results in detox test returning errors.

Upgraded to detox 14.8.0, but still encountering the base issue of Android hanging and not starting the application.

May I suggest: https://android-developers.googleblog.com/2016/04/protecting-against-unintentional.html. I hope this is the cause for your troubles.

@d4vidi We are experiencing the same issue as @bullwrinkle . Unfortunately no luck with the cleartext. I have explicitly set debug and release to allow cleartext, and still the issue persists.

After setting both the debug and release AndroidManfest.xml files to allow cleartext and then removing the android/build directory and performing a clean 'detox build', we're still seeing the issue.

@bullwrinkle would you mind sending over the device logs?
Also, what's the state of the device at this point? I'm suspecting that simply what happens is that the app crashes (possibly due to a bug in Detox). This typically causes a hang because it takes place before the instrumentation has managed to properly connect back to the host.

In addition, for those who have tried this with 14.8.0, please upgrade to 14.8.1

I have tried again with 14.8.1, same result.

detox[4951] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId
=c2d01d80-c2ad-bb23-972d-26491b9214fb)
detox[4951] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, can
not fw action (sessionId=c2d01d80-c2ad-bb23-972d-26491b9214fb)

Upgraded to 14.8.1. Here is the device output:

$ detox test -c android.emu.debug --loglevel trace
detox[61486] INFO: [test.js] configuration="android.emu.debug" loglevel="trace" reportSpecs=true readOnlyEmu=false DETOX_START_TIMESTAMP=1574279584411 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
โ— Deprecation Warning:

Option "setupTestFrameworkScriptFile" was replaced by configuration "setupFilesAfterEnv", which supports multiple paths.

Please update your configuration.

Configuration Documentation:
https://jestjs.io/docs/configuration.html

detox[61487] INFO: [DetoxServer.js] server listening on localhost:49888...
detox[61487] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:49888
detox[61487] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"0394cec6-6cb0-07eb-0b1e-307102267247","role":"tester"},"messageId":0}
detox[61487] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=0394cec6-6cb0-07eb-0b1e-307102267247
detox[61487] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=0394cec6-6cb0-07eb-0b1e-307102267247
detox[61487] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"0394cec6-6cb0-07eb-0b1e-307102267247","role":"tester"},"messageId":0}

detox[61487] DEBUG: [exec.js/EXEC_CMD, #0] "/Users/user/Library/Android/sdk/emulator/emulator" -list-avds --verbose
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #0] Pixel_2_API_29

detox[61487] DEBUG: [exec.js/EXEC_CMD, #1] "/Users/user/Library/Android/sdk/platform-tools/adb" devices
detox[61487] DEBUG: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-19740 device

detox[61487] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 19740, host: localhost
detox[61487] DEBUG: [exec.js/EXEC_CMD, #2] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "getprop dev.bootcomplete"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #2] 1

detox[61487] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-19740' })
detox[61487] DEBUG: [exec.js/EXEC_CMD, #3] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "getprop ro.build.version.sdk"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #3] 29

detox[61487] DEBUG: [exec.js/EXEC_CMD, #4] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "dumpsys power | grep \"^[ ]m[UW].=\""
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #4] mWakefulness=Awake
mWakefulnessChanging=false
mWakeLockSummary=0x1
mUserActivitySummary=0x1
mWakeUpWhenPluggedOrUnpluggedConfig=false
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false

detox[61487] DEBUG: [exec.js/EXEC_CMD, #5] "/Users/user/Library/Android/sdk/build-tools/29.0.2/aapt" dump badging "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/debug/app-debug.apk" | grep -e "package: name="
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='com.heresmyinfo.client.debug' versionCode='55' versionName='0.9.83' compileSdkVersion='28' compileSdkVersionCodename='9'

detox[61487] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeUninstallApp({ deviceId: 'emulator-19740',
bundleId: 'com.heresmyinfo.client.debug' })
detox[61487] DEBUG: [exec.js/EXEC_CMD, #6] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "pm list packages com.heresmyinfo.client.debug"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #6]
detox[61487] DEBUG: [exec.js/EXEC_CMD, #7] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "pm list packages com.heresmyinfo.client.debug.test"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #7]
detox[61487] DEBUG: [exec.js/EXEC_CMD, #8] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 install -r -g -t "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/debug/app-debug.apk"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #8] Performing Streamed Install
Success

detox[61487] DEBUG: [exec.js/EXEC_CMD, #9] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 install -r -g -t "/Users/user/work/myInfo/Client/android/app/build/outputs/apk/androidTest/debug/app-debug-androidTest.apk"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #9] Performing Streamed Install
Success

detox[61487] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-19740',
bundleId: 'com.heresmyinfo.client.debug' })
detox[61487] DEBUG: [exec.js/EXEC_CMD, #10] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "am force-stop com.heresmyinfo.client.debug"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #10]
detox[61487] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-19740',
bundleId: 'com.heresmyinfo.client.debug',
launchArgs:
{ detoxServer: 'ws://localhost:49888',
detoxSessionId: '0394cec6-6cb0-07eb-0b1e-307102267247' } })
detox[61487] DEBUG: [exec.js/EXEC_CMD, #11] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "date +\"%m-%d %T.000\""
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #11] 11-20 11:53:17.000

detox[61487] DEBUG: [exec.js/EXEC_CMD, #12] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 reverse tcp:49888 tcp:49888
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #12] 49888

detox[61487] DEBUG: [exec.js/EXEC_CMD, #13] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "pm list instrumentation"
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #13] instrumentation:com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner (target=com.heresmyinfo.client.debug)

detox[61487] DEBUG: [exec.js/SPAWN_CMD, #14] [pid=61509] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-19740 shell am instrument -w -r -e detoxServer ws://localhost:49888 -e detoxSessionId 0394cec6-6cb0-07eb-0b1e-307102267247 -e debug ZmFsc2U= com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner
detox[61487] DEBUG: [exec.js/EXEC_CMD, #15] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "ps | grep \"com.heresmyinfo.client.debug$\""
detox[61487] ERROR: [exec.js/EXEC_FAIL, #15] ""/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "ps | grep \"com.heresmyinfo.client.debug$\""" failed with code = 1, stdout and stderr:

detox[61487] ERROR: [exec.js/EXEC_FAIL, #15]
detox[61487] ERROR: [exec.js/EXEC_FAIL, #15]
detox[61487] DEBUG: [exec.js/EXEC_CMD, #16] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "ps | grep \"com.heresmyinfo.client.debug$\""
detox[61487] ERROR: [exec.js/EXEC_FAIL, #16] ""/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "ps | grep \"com.heresmyinfo.client.debug$\""" failed with code = 1, stdout and stderr:

detox[61487] ERROR: [exec.js/EXEC_FAIL, #16]
detox[61487] ERROR: [exec.js/EXEC_FAIL, #16]
detox[61487] DEBUG: [exec.js/EXEC_CMD, #17] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-19740 shell "ps | grep \"com.heresmyinfo.client.debug$\""
detox[61487] TRACE: [exec.js/EXEC_SUCCESS, #17] u0_a143 4222 1776 1855248 93636 0 0 R com.heresmyinfo.client.debug

detox[4222] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-19740',
bundleId: 'com.heresmyinfo.client.debug',
launchArgs:
{ detoxServer: 'ws://localhost:49888',
detoxSessionId: '0394cec6-6cb0-07eb-0b1e-307102267247' },
pid: 4222 })
detox[61487] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[61487] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=0394cec6-6cb0-07eb-0b1e-307102267247)
detox[61487] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=0394cec6-6cb0-07eb-0b1e-307102267247)

Tested with the Detox 14.6.3 release and the hanging issue is still present and unchanged.

detox[72137] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeTerminateApp({ deviceId: 'emulator-14918',
bundleId: 'com.heresmyinfo.client.debug' })
detox[72137] DEBUG: [exec.js/EXEC_CMD, #12] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-14918 shell "am force-stop com.heresmyinfo.client.debug"
detox[72137] TRACE: [exec.js/EXEC_SUCCESS, #12]
detox[72137] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-14918',
bundleId: 'com.heresmyinfo.client.debug',
launchArgs:
{ detoxServer: 'ws://localhost:57808',
detoxSessionId: '60c4308a-94fb-87ee-20b1-02772ebfb955' } })
detox[72137] DEBUG: [exec.js/EXEC_CMD, #13] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-14918 shell "date +\"%m-%d %T.000\""
detox[72137] TRACE: [exec.js/EXEC_SUCCESS, #13] 11-27 18:44:05.000

detox[72137] DEBUG: [exec.js/EXEC_CMD, #14] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-14918 reverse tcp:57808 tcp:57808
detox[72137] TRACE: [exec.js/EXEC_SUCCESS, #14] 57808

detox[72137] DEBUG: [exec.js/EXEC_CMD, #15] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-14918 shell "pm list instrumentation"
detox[72137] TRACE: [exec.js/EXEC_SUCCESS, #15] instrumentation:com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner (target=com.heresmyinfo.client.debug)

detox[72137] DEBUG: [exec.js/SPAWN_CMD, #16] [pid=72164] /Users/user/Library/Android/sdk/platform-tools/adb -s emulator-14918 shell am instrument -w -r -e detoxServer ws://localhost:57808 -e detoxSessionId 60c4308a-94fb-87ee-20b1-02772ebfb955 -e debug ZmFsc2U= com.heresmyinfo.client.debug.test/com.android.test.runner.MultiDexTestRunner
detox[72137] DEBUG: [exec.js/EXEC_CMD, #17] "/Users/user/Library/Android/sdk/platform-tools/adb" -s emulator-14918 shell "ps | grep \"com.heresmyinfo.client.debug$\""
detox[72137] TRACE: [exec.js/EXEC_SUCCESS, #17] u0_a147 5631 1776 1881008 115316 0 0 R com.heresmyinfo.client.debug

detox[5631] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-14918',
bundleId: 'com.heresmyinfo.client.debug',
launchArgs:
{ detoxServer: 'ws://localhost:57808',
detoxSessionId: '60c4308a-94fb-87ee-20b1-02772ebfb955' },
pid: 5631 })
detox[72137] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[72137] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=60c4308a-94fb-87ee-20b1-02772ebfb955)
detox[72137] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=60c4308a-94fb-87ee-20b1-02772ebfb955)

I created a brand new RN project to try on a clean project, and it worked successfully. I then created a new branch of my app, tried adding detox to it again, and it also worked. I am no longer encountering this issue, and I'm inclined to believe it was due to some misconfiguration that's easy to run into yet hard to diagnose.

Are you using any Animation libraries in your new project? There is a
related thread https://github.com/wix/Detox/issues/1716, where they are
reporting that the problem disappears when Animation libraries are removed.
We are making significant use of Animation libraries and removing them
isn't an option.

On Thu, Dec 5, 2019 at 8:41 AM Sean Ballew notifications@github.com wrote:

I created a brand new RN project to try on a clean project, and it worked
successfully. I then created a new branch of my app, tried adding detox to
it again, and it also worked. I am no longer encountering this issue, and
I'm inclined to believe it was due to some misconfiguration that's easy to
run into yet hard to diagnose.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/wix/Detox/issues/1743?email_source=notifications&email_token=AAGVYRTNMSIDO5EWNEZH7XTQXEVKJA5CNFSM4JKLGIP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGBKPYI#issuecomment-562210785,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAGVYRXVIM5HTJ52O73ECTTQXEVKJANCNFSM4JKLGIPQ
.

No, we don't have any animation libraries.

Having the same issue. We use Lottie and some animation libs.

It was a setup issue. It works.

Same issue here and I also tried all the suggestions of the other posts/open issues. Nothing is working for us. We have a full test suite running perfectly in iOS. Tried latest 14.9.2 and still same issue.

yarn detox test -c android.emu.debug --loglevel trace -r e2e/testCases/ios/phone/products/addProduct.spec.js
yarn run v1.16.0
$ /Users/imtiyaazganie/Documents/GitHub/yoco-register/node_modules/.bin/detox test -c android.emu.debug --loglevel trace -r e2e/testCases/ios/phone/products/addProduct.spec.js
detox[76937] INFO: [test.js] configuration="android.emu.debug" loglevel="trace" reuse="e2e/testCases/ios/phone/products/addProduct.spec.js" reportSpecs=true readOnlyEmu=false DETOX_START_TIMESTAMP=1577800080457 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
detox[76938] INFO: [DetoxServer.js] server listening on localhost:55093...
detox[76938] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:55093
detox[76938] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"fa3b8ec7-38dd-ea99-d4c3-f858f0349426","role":"tester"},"messageId":0}
detox[76938] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=fa3b8ec7-38dd-ea99-d4c3-f858f0349426
detox[76938] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=fa3b8ec7-38dd-ea99-d4c3-f858f0349426
detox[76938] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"fa3b8ec7-38dd-ea99-d4c3-f858f0349426","role":"tester"},"messageId":0}

detox[76938] DEBUG: [exec.js/EXEC_CMD, #0] "/Users/imtiyaazganie/Library/Android/sdk/emulator/emulator" -list-avds --verbose
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #0] Nexus_5X_API_29_x86
Pixel_2_API_28
Pixel_API_27

detox[76938] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Looking up a device based on Pixel_API_27
detox[76938] DEBUG: [exec.js/EXEC_CMD, #1] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" devices
detox[76938] DEBUG: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-5554 device

detox[76938] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 5554, host: localhost
detox[76938] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Found emulator-5554!
detox[76938] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Settled on emulator-5554
detox[76938] DEBUG: [exec.js/EXEC_CMD, #2] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #2] 1

detox[76938] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-5554' })
detox[76938] DEBUG: [exec.js/EXEC_CMD, #3] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #3] 27

detox[76938] DEBUG: [exec.js/EXEC_CMD, #4] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]m[UW].=\""
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #4] mWakefulness=Awake
mWakefulnessChanging=false
mWakeLockSummary=0x0
mUserActivitySummary=0x1
mWakeUpWhenPluggedOrUnpluggedConfig=false
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false

detox[76938] DEBUG: [exec.js/EXEC_CMD, #5] "/Users/imtiyaazganie/Library/Android/sdk/build-tools/29.0.2/aapt" dump badging "/Users/imtiyaazganie/Documents/GitHub/yoco-register/android/app/build/outputs/apk/debug/app-debug.apk" | grep -e "package: name="
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='za.co.yoco' versionCode='117' versionName='3.4.2' compileSdkVersion='28' compileSdkVersionCodename='9'

detox[76938] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeAll()
detox[76938] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-5554',
bundleId: 'za.co.yoco',
launchArgs:
{ detoxServer: 'ws://localhost:55093',
detoxSessionId: 'fa3b8ec7-38dd-ea99-d4c3-f858f0349426' } })
detox[76938] DEBUG: [exec.js/EXEC_CMD, #6] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\""
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #6] 12-31 15:48:00.000

detox[76938] DEBUG: [exec.js/EXEC_CMD, #7] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:55093 tcp:55093
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #7]
detox[76938] DEBUG: [exec.js/EXEC_CMD, #8] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation"
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #8] instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
instrumentation:org.chromium.webview_shell/.WebViewLayoutTestRunner (target=org.chromium.webview_shell)
instrumentation:za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner (target=za.co.yoco)

detox[76938] DEBUG: [exec.js/SPAWN_CMD, #9] [pid=76952] /Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:55093 -e detoxSessionId fa3b8ec7-38dd-ea99-d4c3-f858f0349426 -e debug false za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner
detox[76938] TRACE: [exec.js/SPAWN_STDOUT, #9] INSTRUMENTATION_STATUS: class=za.co.yoco.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
za.co.yoco.DetoxTest:
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS_CODE: 1

detox[76938] DEBUG: [exec.js/EXEC_CMD, #10] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"za.co.yoco$\""
detox[76938] TRACE: [exec.js/EXEC_SUCCESS, #10] u0_a93 13481 1536 1431272 99412 0 R za.co.yoco

detox[13481] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-5554',
bundleId: 'za.co.yoco',
launchArgs:
{ detoxServer: 'ws://localhost:55093',
detoxSessionId: 'fa3b8ec7-38dd-ea99-d4c3-f858f0349426' },
pid: 13481 })
detox[76938] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[76938] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=fa3b8ec7-38dd-ea99-d4c3-f858f0349426)
detox[76938] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=fa3b8ec7-38dd-ea99-d4c3-f858f0349426)

RUNS e2e/testCases/ios/phone/products/addProduct.spec.js
^C
โžœ yoco-register git:(altus/fix-android-detox) โœ—
โžœ yoco-register git:(altus/fix-android-detox) โœ— yarn detox test -c android.emu.debug --loglevel trace -r e2e/testCases/ios/phone/products/addProduct.spec.js
yarn run v1.16.0
$ /Users/imtiyaazganie/Documents/GitHub/yoco-register/node_modules/.bin/detox test -c android.emu.debug --loglevel trace -r e2e/testCases/ios/phone/products/addProduct.spec.js
detox[76977] INFO: [test.js] configuration="android.emu.debug" loglevel="trace" reuse="e2e/testCases/ios/phone/products/addProduct.spec.js" reportSpecs=true readOnlyEmu=false DETOX_START_TIMESTAMP=1577800102768 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
detox[76978] INFO: [DetoxServer.js] server listening on localhost:55162...
detox[76978] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:55162
detox[76978] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"login","params":{"sessionId":"4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1","role":"tester"},"messageId":0}
detox[76978] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1
detox[76978] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1
detox[76978] TRACE: [AsyncWebSocket.js/WEBSOCKET_MESSAGE] {"type":"loginSuccess","params":{"sessionId":"4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1","role":"tester"},"messageId":0}

detox[76978] DEBUG: [exec.js/EXEC_CMD, #0] "/Users/imtiyaazganie/Library/Android/sdk/emulator/emulator" -list-avds --verbose
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #0] Nexus_5X_API_29_x86
Pixel_2_API_28
Pixel_API_27

detox[76978] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Looking up a device based on Pixel_API_27
detox[76978] DEBUG: [exec.js/EXEC_CMD, #1] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" devices
detox[76978] DEBUG: [exec.js/EXEC_SUCCESS, #1] List of devices attached
emulator-5554 device

detox[76978] TRACE: [EmulatorTelnet.js/TELNET_CONNECTING] port: 5554, host: localhost
detox[76978] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Found emulator-5554!
detox[76978] DEBUG: [EmulatorDriver.js/ACQUIRE_DEVICE] Settled on emulator-5554
detox[76978] DEBUG: [exec.js/EXEC_CMD, #2] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop dev.bootcomplete"
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #2] 1

detox[76978] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBootDevice({ coldBoot: false, deviceId: 'emulator-5554' })
detox[76978] DEBUG: [exec.js/EXEC_CMD, #3] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "getprop ro.build.version.sdk"
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #3] 27

detox[76978] DEBUG: [exec.js/EXEC_CMD, #4] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "dumpsys power | grep \"^[ ]m[UW].=\""
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #4] mWakefulness=Awake
mWakefulnessChanging=false
mWakeLockSummary=0x0
mUserActivitySummary=0x1
mWakeUpWhenPluggedOrUnpluggedConfig=false
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false

detox[76978] DEBUG: [exec.js/EXEC_CMD, #5] "/Users/imtiyaazganie/Library/Android/sdk/build-tools/29.0.2/aapt" dump badging "/Users/imtiyaazganie/Documents/GitHub/yoco-register/android/app/build/outputs/apk/debug/app-debug.apk" | grep -e "package: name="
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #5] package: name='za.co.yoco' versionCode='117' versionName='3.4.2' compileSdkVersion='28' compileSdkVersionCodename='9'

detox[76978] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeAll()
detox[76978] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onBeforeLaunchApp({ deviceId: 'emulator-5554',
bundleId: 'za.co.yoco',
launchArgs:
{ detoxServer: 'ws://localhost:55162',
detoxSessionId: '4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1' } })
detox[76978] DEBUG: [exec.js/EXEC_CMD, #6] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "date +\"%m-%d %T.000\""
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #6] 12-31 15:48:23.000

detox[76978] DEBUG: [exec.js/EXEC_CMD, #7] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse tcp:55162 tcp:55162
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #7]
detox[76978] DEBUG: [exec.js/EXEC_CMD, #8] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "pm list instrumentation"
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #8] instrumentation:com.android.emulator.smoketests/android.support.test.runner.AndroidJUnitRunner (target=com.android.emulator.smoketests)
instrumentation:org.chromium.webview_shell/.WebViewLayoutTestRunner (target=org.chromium.webview_shell)
instrumentation:za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner (target=za.co.yoco)

detox[76978] DEBUG: [exec.js/SPAWN_CMD, #9] [pid=76992] /Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:55162 -e detoxSessionId 4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1 -e debug false za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner
detox[76978] DEBUG: [exec.js/EXEC_CMD, #10] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 shell "ps | grep \"za.co.yoco$\""
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #10] u0_a93 13694 1536 1416532 88576 SyS_epoll_wait 0 S za.co.yoco

detox[13694] TRACE: [ArtifactsManager.js/LIFECYCLE] artifactsManager.onLaunchApp({ deviceId: 'emulator-5554',
bundleId: 'za.co.yoco',
launchArgs:
{ detoxServer: 'ws://localhost:55162',
detoxSessionId: '4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1' },
pid: 13694 })
detox[76978] TRACE: [AsyncWebSocket.js/WEBSOCKET_SEND] {"type":"isReady","params":{},"messageId":-1000}
detox[76978] TRACE: [DetoxServer.js/MESSAGE] role=tester action=isReady (sessionId=4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1)
detox[76978] DEBUG: [DetoxServer.js/CANNOT_FORWARD] role=testee not connected, cannot fw action (sessionId=4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1)
detox[76978] TRACE: [exec.js/SPAWN_STDOUT, #9] INSTRUMENTATION_STATUS: class=za.co.yoco.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stream=
za.co.yoco.DetoxTest:
INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS_CODE: 1

detox[76978] TRACE: [exec.js/SPAWN_STDOUT, #9] INSTRUMENTATION_STATUS: class=za.co.yoco.DetoxTest
INSTRUMENTATION_STATUS: current=1
INSTRUMENTATION_STATUS: id=AndroidJUnitRunner
INSTRUMENTATION_STATUS: numtests=1
INSTRUMENTATION_STATUS: stack=java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=za.co.yoco/.MainActivity (has extras) } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1577800104819 and now the last time the queue went idle was: 1577800104819. If these numbers are the same your activity might be hogging the event queue.
at androidx.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:481)
at androidx.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:358)
at com.wix.detox.Detox.runTests(Detox.java:121)
at com.wix.detox.Detox.runTests(Detox.java:97)
at za.co.yoco.DetoxTest.runDetoxTests(DetoxTest.java:22)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2075)

INSTRUMENTATION_STATUS: stream=
Error in runDetoxTests(za.co.yoco.DetoxTest):
java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=za.co.yoco/.MainActivity (has extras) } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1577800104819 and now the last time the queue went idle was: 1577800104819. If these numbers are the same your activity might be hogging the event queue.
at androidx.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:481)
at androidx.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:358)
at com.wix.detox.Detox.runTests(Detox.java:121)
at com.wix.detox.Detox.runTests(Detox.java:97)
at za.co.yoco.DetoxTest.runDetoxTests(DetoxTest.java:22)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2075)

INSTRUMENTATION_STATUS: test=runDetoxTests
INSTRUMENTATION_STATUS_CODE: -2

detox[76978] TRACE: [exec.js/SPAWN_STDOUT, #9] INSTRUMENTATION_RESULT: stream=

Time: 45.346
There was 1 failure:
1) runDetoxTests(za.co.yoco.DetoxTest)
java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=za.co.yoco/.MainActivity (has extras) } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1577800104819 and now the last time the queue went idle was: 1577800104819. If these numbers are the same your activity might be hogging the event queue.
at androidx.test.runner.MonitoringInstrumentation.startActivitySync(MonitoringInstrumentation.java:481)
at androidx.test.rule.ActivityTestRule.launchActivity(ActivityTestRule.java:358)
at com.wix.detox.Detox.runTests(Detox.java:121)
at com.wix.detox.Detox.runTests(Detox.java:97)
at za.co.yoco.DetoxTest.runDetoxTests(DetoxTest.java:22)
at java.lang.reflect.Method.invoke(Native Method)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
at androidx.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:531)
at org.junit.rules.RunRules.evaluate(RunRules.java:20)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at androidx.test.ext.junit.runners.AndroidJUnit4.run(AndroidJUnit4.java:104)
at org.junit.runners.Suite.runChild(Suite.java:128)
at org.junit.runners.Suite.runChild(Suite.java:27)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
at androidx.test.internal.runner.TestExecutor.execute(TestExecutor.java:56)
at androidx.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:392)
at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:2075)

FAILURES!!!
Tests run: 1, Failures: 1

INSTRUMENTATION_CODE: -1

detox[76978] DEBUG: [exec.js/KILL] sending SIGINT to [pid = 76992]: /Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:55162 -e detoxSessionId 4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1 -e debug false za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner
detox[76978] TRACE: [exec.js/SPAWN_END, #9] /Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb -s emulator-5554 shell am instrument -w -r -e detoxServer ws://localhost:55162 -e detoxSessionId 4d99651f-c71f-b3f2-aeb2-4377b8ea6ed1 -e debug false za.co.yoco.test/androidx.test.runner.AndroidJUnitRunner finished with code = 0
detox[76978] DEBUG: [exec.js/EXEC_CMD, #11] "/Users/imtiyaazganie/Library/Android/sdk/platform-tools/adb" -s emulator-5554 reverse --remove tcp:55162
detox[76978] TRACE: [exec.js/EXEC_SUCCESS, #11]

Could someone perhaps post logs of an android test that works, could help with triaging this issue.

~Having the same issue. We use Lottie and some animation libs.~

It was a setup issue. It works.

@Imtiyaazg my issue was related to config. I had the Java Detox class in the wrong path. I suggest to review step-by-step of the configuration.

~Having the same issue. We use Lottie and some animation libs.~
It was a setup issue. It works.

@Imtiyaazg my issue was related to config. I had the Java Detox class in the wrong path. I suggest to review step-by-step of the configuration.

I created a new branch now, did the setup from scratch. I've double-checked each setup step with the documentation and even tried different path combinations for the Java Detox class, still facing the same issue :(

Does the path for your Detox class follow the exact same path as your MainActivity.java ?

I noticed that the documentation specified that it has to be in a com folder first but my MainApplication.java is in main/java/za/co/appName/MainActivity.java

I've tried using androidTest/java/com/za/co/appName/DetoxTest.java, androidTest/java/com/zacoAppName/DetoxTest.java, androidTest/java/za/co/appName/DetoxTest.java still the same issue. App launched but never kicks off the test, after about a minute it kills the app and I get this error

Time: 45.621
There was 1 failure:
1) runDetoxTests(za.co.yoco.DetoxTest)
java.lang.RuntimeException: Could not launch intent Intent { act=android.intent.action.MAIN flg=0x14000000 cmp=za.co.yoco/.MainActivity (has extras) } within 45 seconds. Perhaps the main thread has not gone idle within a reasonable amount of time? There could be an animation or something constantly repainting the screen. Or the activity is doing network calls on creation? See the threaddump logs. For your reference the last time the event queue was idle before your activity launch request was 1578074624071 and now the last time the queue went idle was: 1578074624225. If these numbers are the same your activity might be hogging the event queue.

Does the path for your Detox class follow the exact same path as your MainActivity.java ?

Almost...
android/app/src/androidTest/java/com/My/App/DetoxTest.java against android/app/src/main/java/com/My/App/MainApplication.java

@Imtiyaazg

Since the discussion here went a bit offtrack (not entirely focused on the original submission), I'll be referring strictly to @bullwrinkle's notes. In that sense, issues with new RN's could be a result of this pending RN issue: https://github.com/facebook/react-native/issues/27010. It is applicable in debug, and can be worked-around, as explained there in one of my comments.

@bullwrinkle please report back if this helps you out. Thanks.

Other than that, in order to try to further help in the future, @bullwrinkle please attach associated device logs (i.e. not logs produced by detox in your terminal, but logs produced by the device, typically queried using an adb logcat command). This is important since it is very likely that the app or instrumentation crash before the detox tester manages to connect to the device, thus not being able to pull and log error info.

Thanks for forwarding that RN issue #27010 to me. My schedule is pretty
filled running around for the next few days, but I'll try to look at it
ASAP and implement their instructions

On Mon, Jan 13, 2020 at 4:48 AM d4vidi notifications@github.com wrote:

Since the discussion here went a bit offtrack (not entirely focused on the
original submission), I'll be referring strictly to @bullwrinkle
https://github.com/bullwrinkle's notes. In that sense, issues with new
RN's could be a result of this pending RN issue:
facebook/react-native#27010
https://github.com/facebook/react-native/issues/27010. It is applicable
in debug, and can be worked-around, as explained there in one of my
comments.

@bullwrinkle https://github.com/bullwrinkle please report back if this
helps you out. Thanks.

โ€”
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/wix/Detox/issues/1743?email_source=notifications&email_token=AAGVYRWOXQDI4L4DXDYXKR3Q5RPK5A5CNFSM4JKLGIP2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEIYSRXQ#issuecomment-573647070,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AAGVYRXGSLTV3H7X3EZPH4DQ5RPK5ANCNFSM4JKLGIPQ
.

@bullwrinkle any news? I would also appreciate getting the associated _device_ logs (tbh, can't do much without them).

Unfortunately, the solution described in https://github.com/facebook/react-native/issues/27010 ...

(run sed -i bak 's/Platform.isTesting/false/g' node_modules/react-native/Libraries/Animated/src/Animated.js post-install)

..didn't work for me. It still fails to connect and launch the app. Maybe it's because I'm using react-native-reanimated?

I'm also getting this warning in logcat. Might be related?

01-22 10:44:20.456  7438  7438 W rkers.companio: Opening an oat file without a class loader. Are you using the deprecated DexFile APIs?

@bullwrinkle please read - https://github.com/wix/Detox/issues/1450#issuecomment-577126240

I've added some further description of how the clear-text issue can be tackled in our android-troubleshooting guide: https://github.com/wix/Detox/blob/master/docs/Introduction.Android.md#problem-the-app-loads-but-tests-fail-to-start-in-sdk--28

Hi guys,

Still with the same problem using "react-native": "0.61.3" and "detox": "^14.9.2". Already tried to add android:usesCleartextTraffic="true" and also using the network_security_config.xml but with no luck.

@leoneperdigao please provide all the details in a specific issue, thanks.

Locked so as to prevent more _me too_ comments posted with very little or cluttered info. @bullwrinkle please let me know when you're ready to follow this up, on a separate issue.

@bullwrinkle I'd be happy to get updates on this

I have a very same issue with RN 0.61.2, detox 15.4.2. Actually, my issue is that the app in android emulator is crashed right after showing splash screen after I run test. Crash message is pointing the one of my module related to animation, throwing RangeError: Maximum call stack size exceeded, in the Shine in skeleton animation. But, it works fine in iOS simulator.

I can provide whatever logs you want, I really want to test in android emulator.

image

@mattdamon108 consider applying this workaround: https://github.com/facebook/react-native/issues/27010#issuecomment-573645965

@bullwrinkle Sorry, seems like I have to close this. I hope you're getting along ok nevertheless.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexmngn picture alexmngn  ยท  3Comments

gtRfnkN picture gtRfnkN  ยท  4Comments

tomball123 picture tomball123  ยท  4Comments

jrobber picture jrobber  ยท  3Comments

LeoNatan picture LeoNatan  ยท  4Comments