Detox
Detox copied to clipboard
Android: APP_UNREACHABLE for compiling dependency Detox setup
What happened?
I've setup my project using the compiling dependency option. I've got the test build and debug builds working. When I run yarn detox test -c android
, the emulator starts, installs the app, but fails without opening the app. Logs included below.
I ran through the three recommended debugging tips in the troubleshooting guide. I have an await device.launchApp()
, and the app starts correctly when ran manually in the emulator. As for the test Java class, since Detox is set as a compiling dependency, I do not have a custom class file in the android/src folder.
I also tried downgrading to detox v19.5.1, with no luck.
What was the expected behaviour?
My tests run correctly on the open app on the running emulator.
Was it tested on latest Detox?
- [X] I have tested this issue on the latest Detox release and it still reproduces.
Did your test throw out a timeout?
- [X] I have followed the instructions under Identifying which synchronization mechanism causes us to wait too much.
Help us reproduce this issue!
No response
In what environment did this happen?
Detox version: 19.7.1 React Native version: package.json reports 0.66.4, yarn react-native --version reports 6.0.1? Node version: 16.15.0 Device model: sdk_gphone64_x86_64 Android version: 12 Test-runner: jest-circus
Detox logs
Detox logs
project on brycek-detox-bvt-2 [✘!?] is 📦 v1.0.0 via ⬢ v16.15.0 took 10m 16s
➜ yarn detox test -c android --loglevel trace
yarn run v1.22.18
$ /Users/brycek/dev/project/node_modules/.bin/detox test -c android --loglevel trace
16:46:02.066 detox[55365] INFO: [test.js] DETOX_CONFIGURATION="android" DETOX_LOGLEVEL="trace" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1654127162061 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/detox/config.json --testNamePattern '^((?!:ios:).)*$' e2e
16:46:04.744 detox[55374] TRACE: [DETOX_CREATE] created a Detox instance with config:
{
appsConfig: {
default: {
type: 'android.apk',
build: '(cd native/android/[[company]] && ./gradlew assembleInternalDebug assembleInternalDebugAndroidTest -DtestBuildType=debug)',
binaryPath: 'native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk',
testBinaryPath: 'native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk'
}
},
artifactsConfig: {
rootDir: 'artifacts/android.2022-06-01 23-46-02Z',
plugins: {
log: {
enabled: false,
keepOnlyFailedTestsArtifacts: false
},
screenshot: {
enabled: true,
shouldTakeAutomaticSnapshots: false,
keepOnlyFailedTestsArtifacts: false
},
video: {
enabled: false,
keepOnlyFailedTestsArtifacts: false
},
instruments: {
enabled: false,
keepOnlyFailedTestsArtifacts: false
},
timeline: {
enabled: false
},
uiHierarchy: {
enabled: false,
keepOnlyFailedTestsArtifacts: false
}
},
pathBuilder: ArtifactPathBuilder {
_rootDir: 'artifacts/android.2022-06-01 23-46-02Z'
}
},
behaviorConfig: {
init: {
reinstallApp: true,
exposeGlobals: true
},
cleanup: {
shutdownDevice: false
},
launchApp: 'auto'
},
cliConfig: {
configuration: 'android',
loglevel: 'trace',
useCustomLogger: true
},
configurationName: 'android',
deviceConfig: {
type: 'android.emulator',
device: {
avdName: 'Pixel_4_API_32'
}
},
runnerConfig: {
testRunner: 'jest',
runnerConfig: 'e2e/detox/config.json',
specs: 'e2e',
skipLegacyWorkersInjection: true
},
sessionConfig: {
autoStart: true,
sessionId: '7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a',
debugSynchronization: 10000
}
}
16:46:04.750 detox[55374] DEBUG: [WSS_CREATE] Detox server listening on localhost:63289...
16:46:04.762 detox[55374] DEBUG: [WSS_CONNECTION, #63290] registered a new connection.
16:46:04.764 detox[55374] TRACE: [WS_OPEN] opened web socket to: ws://localhost:63289
16:46:04.767 detox[55374] TRACE: [WS_SEND] {"type":"login","params":{"sessionId":"7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a","role":"tester"},"messageId":0}
16:46:04.769 detox[55374] TRACE: [WSS_GET_FROM, #63290] {"type":"login","params":{"sessionId":"7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a","role":"tester"},"messageId":0}
16:46:04.769 detox[55374] TRACE: [SESSION_CREATED] created session 7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a
16:46:04.770 detox[55374] TRACE: [WSS_SEND_TO, #tester] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
16:46:04.770 detox[55374] TRACE: [SESSION_JOINED] tester joined session 7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a
16:46:04.771 detox[55374] TRACE: [WS_MESSAGE] {"type":"loginSuccess","params":{"testerConnected":true,"appConnected":false},"messageId":0}
16:46:04.841 detox[55374] DEBUG: [EXEC_CMD, #0] "/Users/brycek/Library/Android/sdk/emulator/emulator" -list-avds --verbose
16:46:04.912 detox[55374] TRACE: [EXEC_SUCCESS, #0] 8_Fold-out_API_32
Pixel_4_API_32
project-2019
16:46:04.913 detox[55374] DEBUG: [EXEC_CMD, #1] "/Users/brycek/Library/Android/sdk/emulator/emulator" -version
16:46:05.130 detox[55374] TRACE: [EXEC_SUCCESS, #1] Android emulator version 31.2.10.0 (build_id 8420304) (CL:N/A)
// SNIP
16:46:05.132 detox[55374] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 2, patch: 10, toString: [Function: toString] }
16:46:05.132 detox[55374] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "Pixel_4_API_32"
16:46:05.136 detox[55374] DEBUG: [EXEC_CMD, #2] "/Users/brycek/Library/Android/sdk/platform-tools/adb" devices
16:46:05.170 detox[55374] DEBUG: [EXEC_SUCCESS, #2] List of devices attached
emulator-19302 device
16:46:05.173 detox[55374] TRACE: [TELNET_CONNECTING] port: 19302, host: localhost
16:46:05.180 detox[55374] DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-19302
16:46:05.181 detox[55374] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-19302
16:46:05.182 detox[55374] DEBUG: [EXEC_CMD, #3] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "getprop dev.bootcomplete"
16:46:05.238 detox[55374] TRACE: [EXEC_SUCCESS, #3] 1
16:46:05.239 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBootDevice({ deviceId: 'emulator-19302', type: 'Pixel_4_API_32', coldBoot: false })
16:46:05.240 detox[55374] DEBUG: [EXEC_CMD, #4] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "getprop ro.build.version.sdk"
16:46:05.290 detox[55374] TRACE: [EXEC_SUCCESS, #4] 32
16:46:05.291 detox[55374] DEBUG: [EXEC_CMD, #5] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "settings put global animator_duration_scale 0"
16:46:05.366 detox[55374] TRACE: [EXEC_SUCCESS, #5]
16:46:05.366 detox[55374] DEBUG: [EXEC_CMD, #6] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "settings put global window_animation_scale 0"
16:46:05.426 detox[55374] TRACE: [EXEC_SUCCESS, #6]
16:46:05.427 detox[55374] DEBUG: [EXEC_CMD, #7] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "settings put global transition_animation_scale 0"
16:46:05.488 detox[55374] TRACE: [EXEC_SUCCESS, #7]
16:46:05.489 detox[55374] DEBUG: [EXEC_CMD, #8] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "dumpsys power | grep \"^[ ]*m[UW].*=\""
16:46:05.647 detox[55374] TRACE: [EXEC_SUCCESS, #8] mWakefulness=Awake
mWakefulnessChanging=false
mWakeLockSummary=0x0
mWakeUpWhenPluggedOrUnpluggedConfig=false
mWakeUpWhenPluggedOrUnpluggedInTheaterModeConfig=false
mUserActivityTimeoutOverrideFromWindowManager=-1
mUserInactiveOverrideFromWindowManager=false
mUserId=0
mWakeLockSummary=0x0
mUserInteractionBackoffMillis=60000
16:46:05.666 detox[55374] DEBUG: [EXEC_CMD, #9] "/Users/brycek/Library/Android/sdk/build-tools/31.0.0/aapt" dump badging "/Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk"
16:46:05.779 detox[55374] TRACE: [EXEC_SUCCESS, #9] package: name='com.[[company]].androidapp.internal' versionCode='7720' versionName='5.66' compileSdkVersion='31' compileSdkVersionCodename='12'
sdkVersion:'26'
targetSdkVersion:'31'
// FEATURES
16:46:05.797 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:05.798 detox[55374] DEBUG: [EXEC_CMD, #10] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "am force-stop com.[[company]].androidapp.internal"
16:46:05.882 detox[55374] TRACE: [EXEC_SUCCESS, #10]
16:46:05.883 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:05.885 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeUninstallApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:05.885 detox[55374] DEBUG: [EXEC_CMD, #11] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "pm list packages com.[[company]].androidapp.internal"
16:46:05.978 detox[55374] TRACE: [EXEC_SUCCESS, #11] package:com.[[company]].androidapp.internal.test
package:com.[[company]].androidapp.internal
16:46:05.979 detox[55374] DEBUG: [EXEC_CMD, #12] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 uninstall com.[[company]].androidapp.internal
16:46:06.436 detox[55374] TRACE: [EXEC_SUCCESS, #12] Success
16:46:06.437 detox[55374] DEBUG: [EXEC_CMD, #13] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "pm list packages com.[[company]].androidapp.internal.test"
16:46:06.510 detox[55374] TRACE: [EXEC_SUCCESS, #13] package:com.[[company]].androidapp.internal.test
16:46:06.511 detox[55374] DEBUG: [EXEC_CMD, #14] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 uninstall com.[[company]].androidapp.internal.test
16:46:07.095 detox[55374] TRACE: [EXEC_SUCCESS, #14] Success
16:46:07.096 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:07.097 detox[55374] DEBUG: [EXEC_CMD, #15] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "am force-stop com.[[company]].androidapp.internal"
16:46:07.218 detox[55374] TRACE: [EXEC_SUCCESS, #15]
16:46:07.219 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:07.220 detox[55374] DEBUG: [EXEC_CMD, #16] "/Users/brycek/Library/Android/sdk/build-tools/31.0.0/aapt" dump xmlstrings "/Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk" AndroidManifest.xml
16:46:07.255 detox[55374] TRACE: [EXEC_SUCCESS, #16] String pool of 261 unique UTF-16 non-sorted strings, 261 entries and 0 styles using 21128 bytes:
// STRINGS
16:46:07.259 detox[55374] DEBUG: [EXEC_CMD, #17] "/Users/brycek/Library/Android/sdk/build-tools/31.0.0/aapt" dump xmlstrings "/Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk" AndroidManifest.xml
16:46:07.300 detox[55374] TRACE: [EXEC_SUCCESS, #17] String pool of 42 unique UTF-16 non-sorted strings, 42 entries and 0 styles using 2172 bytes:
// STRINGS
16:46:07.302 detox[55374] DEBUG: [EXEC_CMD, #18] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "rm -fr /data/local/tmp/detox"
16:46:07.404 detox[55374] TRACE: [EXEC_SUCCESS, #18]
16:46:07.404 detox[55374] DEBUG: [EXEC_CMD, #19] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "mkdir -p /data/local/tmp/detox"
16:46:07.469 detox[55374] TRACE: [EXEC_SUCCESS, #19]
16:46:07.470 detox[55374] DEBUG: [EXEC_CMD, #20] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 push "/Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk" "/data/local/tmp/detox/Application.apk"
16:46:10.198 detox[55374] TRACE: [EXEC_SUCCESS, #20] /Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk: 1 file pushed, 0 skipped. 124.1 MB/s (294831590 bytes in 2.266s)
16:46:10.212 detox[55374] DEBUG: [SPAWN_CMD, #21, cpid=55431] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell pm install -r -g -t /data/local/tmp/detox/Application.apk
16:46:12.303 detox[55374] TRACE: [SPAWN_STDOUT, #21, cpid=55431] Success
16:46:12.306 detox[55374] DEBUG: [SPAWN_END, #21, cpid=55431] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0
16:46:12.307 detox[55374] DEBUG: [EXEC_CMD, #22] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 push "/Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk"
16:46:12.392 detox[55374] TRACE: [EXEC_SUCCESS, #22] /Users/brycek/dev/project/native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk: 1 file pushed, 0 skipped. 165.6 MB/s (2599562 bytes in 0.015s)
16:46:12.405 detox[55374] DEBUG: [SPAWN_CMD, #23, cpid=55445] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell pm install -r -g -t /data/local/tmp/detox/Test.apk
16:46:12.732 detox[55374] TRACE: [SPAWN_STDOUT, #23, cpid=55445] Success
16:46:12.742 detox[55374] DEBUG: [SPAWN_END, #23, cpid=55445] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0
16:46:12.750 ROOT_DESCRIBE_BLOCK[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'ROOT_DESCRIBE_BLOCK' })
16:46:12.752 Example[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeStart({ name: 'Example' })
16:46:12.753 detox[55374] INFO: Example is assigned to emulator-19302 (Pixel_4_API_32)
16:46:12.762 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:12.763 detox[55374] DEBUG: [EXEC_CMD, #24] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "am force-stop com.[[company]].androidapp.internal"
16:46:12.934 detox[55374] TRACE: [EXEC_SUCCESS, #24]
16:46:12.934 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onTerminateApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal'
})
16:46:12.935 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeLaunchApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal',
launchArgs: {
detoxServer: 'ws://localhost:63289',
detoxSessionId: '7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a'
}
})
16:46:12.936 detox[55374] DEBUG: [EXEC_CMD, #25] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "date +\"%m-%d %T.000\""
16:46:13.018 detox[55374] TRACE: [EXEC_SUCCESS, #25] 06-01 16:46:09.000
16:46:13.019 detox[55374] DEBUG: [EXEC_CMD, #26] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 reverse tcp:63289 tcp:63289
16:46:13.053 detox[55374] TRACE: [EXEC_SUCCESS, #26] 63289
16:46:13.055 detox[55374] DEBUG: [EXEC_CMD, #27] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "pm list instrumentation"
16:46:13.180 detox[55374] TRACE: [EXEC_SUCCESS, #27] instrumentation:com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner (target=com.[[company]].androidapp.internal)
16:46:13.195 detox[55374] DEBUG: [SPAWN_CMD, #28, cpid=55453] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:63289 -e detoxSessionId 7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner
16:46:13.696 detox[55374] DEBUG: [EXEC_CMD, #29] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 shell "ps | grep \"com\.[[company]]\.androidapp\.internal$\""
16:46:14.991 detox[55374] TRACE: [EXEC_SUCCESS, #29] u0_a201 5626 14760 14626520 164748 0 0 R com.[[company]].androidapp.internal
16:46:14.992 detox[5626] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onLaunchApp({
deviceId: 'emulator-19302',
bundleId: 'com.[[company]].androidapp.internal',
launchArgs: {
detoxServer: 'ws://localhost:63289',
detoxSessionId: '7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a'
},
pid: 5626
})
16:46:17.952 detox[55374] TRACE: [SPAWN_STDOUT, #28, cpid=55453] INSTRUMENTATION_RESULT: stream=
Time: 0
OK (0 tests)
INSTRUMENTATION_CODE: -1
16:46:18.838 detox[55374] DEBUG: [SPAWN_END, #28, cpid=55453] /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:63289 -e detoxSessionId 7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner exited with code #0
16:46:18.838 detox[55374] DEBUG: [EXEC_CMD, #30] "/Users/brycek/Library/Android/sdk/platform-tools/adb" -s emulator-19302 reverse --remove tcp:63289
16:46:18.858 detox[55374] 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 Object.launchApp (/Users/brycek/dev/project/e2e/detox/firstTest.e2e.js:3:22)
at Promise.then.completed (/Users/brycek/dev/project/node_modules/jest-circus/build/utils.js:333:28)
at new Promise (<anonymous>)
at callAsyncCircusFn (/Users/brycek/dev/project/node_modules/jest-circus/build/utils.js:259:10)
at _callCircusHook (/Users/brycek/dev/project/node_modules/jest-circus/build/run.js:239:40)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at _runTestsForDescribeBlock (/Users/brycek/dev/project/node_modules/jest-circus/build/run.js:56:7)
at _runTestsForDescribeBlock (/Users/brycek/dev/project/node_modules/jest-circus/build/run.js:90:9)
at run (/Users/brycek/dev/project/node_modules/jest-circus/build/run.js:31:3)
at runAndTransformResultsToJestFormat (/Users/brycek/dev/project/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:135:21)
at jestAdapter (/Users/brycek/dev/project/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:92:19)
at runTestInternal (/Users/brycek/dev/project/node_modules/jest-runner/build/runTest.js:411:16)
at runTest (/Users/brycek/dev/project/node_modules/jest-runner/build/runTest.js:499:34)
at TestRunner.runTests (/Users/brycek/dev/project/node_modules/jest-runner/build/index.js:145:12),
hook: 'beforeAll'
})
16:46:18.861 detox[55374] INFO: Example: should have welcome screen
16:46:18.863 detox[55374] INFO: Example: should have welcome screen [FAIL]
16:46:18.865 detox[55374] INFO: Example: should show hello screen after tap
16:46:18.865 detox[55374] INFO: Example: should show hello screen after tap [FAIL]
16:46:18.866 detox[55374] INFO: Example: should show world screen after tap
16:46:18.866 detox[55374] INFO: Example: should show world screen after tap [FAIL]
16:46:18.867 Example[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'Example' })
16:46:18.867 ROOT_DESCRIBE_BLOCK[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' })
16:46:18.930 detox[55374] TRACE: [ARTIFACTS_LIFECYCLE] artifactsManager.onBeforeCleanup()
16:46:18.931 detox[55374] ERROR: [APP_UNREACHABLE] Detox can't seem to connect to the test app(s)!
HINT:
The test app might have crashed prematurely, or has had trouble setting up the connection.
Refer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs
16:46:18.933 detox[55374] TRACE: [EXEC_SUCCESS, #30]
16:46:18.939 detox[55374] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
FAIL e2e/detox/firstTest.e2e.js (14.75 s)
Example
✕ should have welcome screen (2 ms)
✕ should show hello screen after tap (1 ms)
✕ should show world screen after tap (1 ms)
● Example › should have welcome screen
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.
1 | describe("Example", () => {
2 | beforeAll(async () => {
> 3 | await device.launchApp();
| ^
4 | await new Promise((resolve) => {
5 | setTimeout(() => resolve, 5000);
6 | });
at Object.launchApp (firstTest.e2e.js:3:22)
● Example › should show hello screen after tap
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.
1 | describe("Example", () => {
2 | beforeAll(async () => {
> 3 | await device.launchApp();
| ^
4 | await new Promise((resolve) => {
5 | setTimeout(() => resolve, 5000);
6 | });
at Object.launchApp (firstTest.e2e.js:3:22)
● Example › should show world screen after tap
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.
1 | describe("Example", () => {
2 | beforeAll(async () => {
> 3 | await device.launchApp();
| ^
4 | await new Promise((resolve) => {
5 | setTimeout(() => resolve, 5000);
6 | });
at Object.launchApp (firstTest.e2e.js:3:22)
16:46:18.968 detox[55374] TRACE: [SESSION_TORN] tester exited session 7daa28bd-bbf7-2ee5-1f1f-d9b81e0e0d0a
16:46:19.068 detox[55365] ERROR: [cli.js] Command failed: jest --config e2e/detox/config.json --testNamePattern '^((?!:ios:).)*$' e2e
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Device logs
Device logs
[
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Detox.js",
"level": 10,
"event": "DETOX_CREATE",
"config": {
"appsConfig": {
"default": {
"type": "android.apk",
"build": "(cd native/android/[[company]] && ./gradlew assembleInternalDebug assembleInternalDebugAndroidTest -DtestBuildType=debug)",
"binaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk",
"testBinaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk"
}
},
"artifactsConfig": {
"rootDir": "artifacts/android.2022-06-02 00-04-07Z",
"plugins": {
"log": {
"enabled": true,
"keepOnlyFailedTestsArtifacts": false
},
"screenshot": {
"enabled": true,
"shouldTakeAutomaticSnapshots": false,
"keepOnlyFailedTestsArtifacts": false
},
"video": {
"enabled": false,
"keepOnlyFailedTestsArtifacts": false
},
"instruments": {
"enabled": false,
"keepOnlyFailedTestsArtifacts": false
},
"timeline": {
"enabled": false
},
"uiHierarchy": {
"enabled": false,
"keepOnlyFailedTestsArtifacts": false
}
},
"pathBuilder": {
"_rootDir": "artifacts/android.2022-06-02 00-04-07Z"
}
},
"behaviorConfig": {
"init": {
"reinstallApp": true,
"exposeGlobals": true
},
"cleanup": {
"shutdownDevice": false
},
"launchApp": "auto"
},
"cliConfig": {
"recordLogs": "all",
"configuration": "android",
"useCustomLogger": true
},
"configurationName": "android",
"deviceConfig": {
"type": "android.emulator",
"device": {
"avdName": "Pixel_4_API_32"
}
},
"errorComposer": {
"configurationName": "android",
"filepath": "/Users/brycek/dev/[[project]]/.detoxrc.json",
"contents": {
"testRunner": "jest",
"runnerConfig": "e2e/detox/config.json",
"skipLegacyWorkersInjection": true,
"apps": {
"ios": {
"type": "ios.app",
"binaryPath": "SPECIFY_PATH_TO_YOUR_APP_BINARY"
},
"android": {
"type": "android.apk",
"build": "(cd native/android/[[company]] && ./gradlew assembleInternalDebug assembleInternalDebugAndroidTest -DtestBuildType=debug)",
"binaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk",
"testBinaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk"
}
},
"devices": {
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 12 Pro Max"
}
},
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "Pixel_4_API_32"
}
}
},
"configurations": {
"ios": {
"device": "simulator",
"app": "ios"
},
"android": {
"device": "emulator",
"app": "android"
}
}
},
"_extends": false
},
"runnerConfig": {
"testRunner": "jest",
"runnerConfig": "e2e/detox/config.json",
"specs": "e2e",
"skipLegacyWorkersInjection": true
},
"sessionConfig": {
"autoStart": true,
"sessionId": "5513f2e0-c8e1-a017-2eb2-30467f79a52b",
"debugSynchronization": 10000
}
},
"msg": "created a Detox instance with config:\n{\n appsConfig: {\n default: {\n type: 'android.apk',\n build: '(cd native/android/[[company]] && ./gradlew assembleInternalDebug assembleInternalDebugAndroidTest -DtestBuildType=debug)',\n binaryPath: 'native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk',\n testBinaryPath: 'native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk'\n }\n },\n artifactsConfig: {\n rootDir: 'artifacts/android.2022-06-02 00-04-07Z',\n plugins: {\n log: {\n enabled: true,\n keepOnlyFailedTestsArtifacts: false\n },\n screenshot: {\n enabled: true,\n shouldTakeAutomaticSnapshots: false,\n keepOnlyFailedTestsArtifacts: false\n },\n video: {\n enabled: false,\n keepOnlyFailedTestsArtifacts: false\n },\n instruments: {\n enabled: false,\n keepOnlyFailedTestsArtifacts: false\n },\n timeline: {\n enabled: false\n },\n uiHierarchy: {\n enabled: false,\n keepOnlyFailedTestsArtifacts: false\n }\n },\n pathBuilder: ArtifactPathBuilder {\n _rootDir: 'artifacts/android.2022-06-02 00-04-07Z'\n }\n },\n behaviorConfig: {\n init: {\n reinstallApp: true,\n exposeGlobals: true\n },\n cleanup: {\n shutdownDevice: false\n },\n launchApp: 'auto'\n },\n cliConfig: {\n recordLogs: 'all',\n configuration: 'android',\n useCustomLogger: true\n },\n configurationName: 'android',\n deviceConfig: {\n type: 'android.emulator',\n device: {\n avdName: 'Pixel_4_API_32'\n }\n },\n runnerConfig: {\n testRunner: 'jest',\n runnerConfig: 'e2e/detox/config.json',\n specs: 'e2e',\n skipLegacyWorkersInjection: true\n },\n sessionConfig: {\n autoStart: true,\n sessionId: '5513f2e0-c8e1-a017-2eb2-30467f79a52b',\n debugSynchronization: 10000\n }\n}",
"time": "2022-06-02T00:04:11.097Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "DetoxServer.js",
"level": 20,
"event": "WSS_CREATE",
"msg": "Detox server listening on localhost:64545...",
"time": "2022-06-02T00:04:11.103Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "DetoxConnection.js",
"trackingId": 64546,
"level": 20,
"event": "WSS_CONNECTION",
"msg": "registered a new connection.",
"time": "2022-06-02T00:04:11.113Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "AsyncWebSocket.js",
"url": "ws://localhost:64545",
"level": 10,
"event": "WS_OPEN",
"msg": "opened web socket to: ws://localhost:64545",
"time": "2022-06-02T00:04:11.115Z",
"v": 0
},
{
"msg": "snipped for length"
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse tcp:64545 tcp:64545",
"trackingId": 26,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse tcp:64545 tcp:64545",
"time": "2022-06-02T00:04:19.292Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse tcp:64545 tcp:64545",
"trackingId": 26,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "64545\n",
"time": "2022-06-02T00:04:19.322Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"pm list instrumentation\"",
"trackingId": 27,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"pm list instrumentation\"",
"time": "2022-06-02T00:04:19.323Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"pm list instrumentation\"",
"trackingId": 27,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "instrumentation:com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner (target=com.[[company]].androidapp.internal)\n",
"time": "2022-06-02T00:04:19.404Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "spawn.js",
"fn": "spawnAndLog",
"command": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:64545 -e detoxSessionId 5513f2e0-c8e1-a017-2eb2-30467f79a52b -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner",
"trackingId": 28,
"cpid": 57762,
"level": 20,
"event": "SPAWN_CMD",
"msg": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:64545 -e detoxSessionId 5513f2e0-c8e1-a017-2eb2-30467f79a52b -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner",
"time": "2022-06-02T00:04:19.417Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"ps | grep \\\"com\\.[[company]]\\.androidapp\\.internal$\\\"\"",
"trackingId": 29,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"ps | grep \\\"com\\.[[company]]\\.androidapp\\.internal$\\\"\"",
"time": "2022-06-02T00:04:19.918Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"ps | grep \\\"com\\.[[company]]\\.androidapp\\.internal$\\\"\"",
"trackingId": 29,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "u0_a203 6361 14760 14586780 123228 0 0 R com.[[company]].androidapp.internal\n",
"time": "2022-06-02T00:04:21.187Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 6361,
"__filename": "ArtifactsManager.js",
"level": 10,
"event": "ARTIFACTS_LIFECYCLE",
"fn": "onLaunchApp",
"deviceId": "emulator-19302",
"bundleId": "com.[[company]].androidapp.internal",
"launchArgs": {
"detoxServer": "ws://localhost:64545",
"detoxSessionId": "5513f2e0-c8e1-a017-2eb2-30467f79a52b"
},
"msg": "artifactsManager.onLaunchApp({\n deviceId: 'emulator-19302',\n bundleId: 'com.[[company]].androidapp.internal',\n launchArgs: {\n detoxServer: 'ws://localhost:64545',\n detoxSessionId: '5513f2e0-c8e1-a017-2eb2-30467f79a52b'\n },\n pid: 6361\n})",
"time": "2022-06-02T00:04:21.188Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "ADBLogcatRecording",
"level": 10,
"event": "ARTIFACT_START",
"msg": "starting ADBLogcatRecording",
"time": "2022-06-02T00:04:21.189Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "spawn.js",
"fn": "spawnAndLog",
"command": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell \"logcat -T \\\"06-01 17:04:16.000\\\" --pid=6361 -f /sdcard/17411170_0.log\"",
"trackingId": 30,
"cpid": 57769,
"level": 20,
"event": "SPAWN_CMD",
"msg": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell \"logcat -T \\\"06-01 17:04:16.000\\\" --pid=6361 -f /sdcard/17411170_0.log\"",
"time": "2022-06-02T00:04:21.199Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell du /sdcard/17411170_0.log",
"trackingId": 31,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell du /sdcard/17411170_0.log",
"time": "2022-06-02T00:04:21.503Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell du /sdcard/17411170_0.log",
"trackingId": 31,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "4\t/sdcard/17411170_0.log\n",
"time": "2022-06-02T00:04:21.563Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "spawn.js",
"fn": "spawnAndLog",
"command": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:64545 -e detoxSessionId 5513f2e0-c8e1-a017-2eb2-30467f79a52b -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner",
"trackingId": 28,
"cpid": 57762,
"level": 10,
"stdout": true,
"event": "SPAWN_STDOUT",
"msg": "INSTRUMENTATION_RESULT: stream=\n\nTime: 0\n\nOK (0 tests)\n\n\nINSTRUMENTATION_CODE: -1\n",
"time": "2022-06-02T00:04:33.900Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "spawn.js",
"fn": "spawnAndLog",
"command": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:64545 -e detoxSessionId 5513f2e0-c8e1-a017-2eb2-30467f79a52b -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner",
"trackingId": 28,
"cpid": 57762,
"level": 20,
"event": "SPAWN_END",
"signal": "",
"code": 0,
"msg": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell am instrument -w -r -e detoxServer ws://localhost:64545 -e detoxSessionId 5513f2e0-c8e1-a017-2eb2-30467f79a52b -e debug false com.[[company]].androidapp.internal.test/androidx.test.runner.AndroidJUnitRunner exited with code #0",
"time": "2022-06-02T00:04:34.808Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse --remove tcp:64545",
"trackingId": 32,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse --remove tcp:64545",
"time": "2022-06-02T00:04:34.809Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "ArtifactsManager.js",
"level": 10,
"event": "ARTIFACTS_LIFECYCLE",
"fn": "onHookFailure",
"error": {
"name": "DetoxRuntimeError"
},
"hook": "beforeAll",
"msg": "artifactsManager.onHookFailure({\n error: DetoxRuntimeError: Failed to run application on the device\n \n 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.\n at Object.launchApp (/Users/brycek/dev/[[project]]/e2e/detox/firstTest.e2e.js:3:22)\n at Promise.then.completed (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/utils.js:333:28)\n at new Promise (<anonymous>)\n at callAsyncCircusFn (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/utils.js:259:10)\n at _callCircusHook (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/run.js:239:40)\n at processTicksAndRejections (node:internal/process/task_queues:96:5)\n at _runTestsForDescribeBlock (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/run.js:56:7)\n at _runTestsForDescribeBlock (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/run.js:90:9)\n at run (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/run.js:31:3)\n at runAndTransformResultsToJestFormat (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapterInit.js:135:21)\n at jestAdapter (/Users/brycek/dev/[[project]]/node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:92:19)\n at runTestInternal (/Users/brycek/dev/[[project]]/node_modules/jest-runner/build/runTest.js:411:16)\n at runTest (/Users/brycek/dev/[[project]]/node_modules/jest-runner/build/runTest.js:499:34)\n at TestRunner.runTests (/Users/brycek/dev/[[project]]/node_modules/jest-runner/build/index.js:145:12),\n hook: 'beforeAll'\n})",
"time": "2022-06-02T00:04:34.823Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould have welcome screen\u001b[39m",
"time": "2022-06-02T00:04:34.824Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould have welcome screen\u001b[39m\u001b[90m [\u001b[31mFAIL\u001b[90m]\u001b[39m",
"time": "2022-06-02T00:04:34.826Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould show hello screen after tap\u001b[39m",
"time": "2022-06-02T00:04:34.828Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould show hello screen after tap\u001b[39m\u001b[90m [\u001b[31mFAIL\u001b[90m]\u001b[39m",
"time": "2022-06-02T00:04:34.829Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould show world screen after tap\u001b[39m",
"time": "2022-06-02T00:04:34.829Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"level": 30,
"event": "SPEC_STATE_CHANGE",
"msg": "\u001b[1m\u001b[37mExample: \u001b[39m\u001b[22m\u001b[90mshould show world screen after tap\u001b[39m\u001b[90m [\u001b[31mFAIL\u001b[90m]\u001b[39m",
"time": "2022-06-02T00:04:34.829Z",
"v": 0
},
{
"name": "Example",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "ArtifactsManager.js",
"level": 10,
"event": "ARTIFACTS_LIFECYCLE",
"fn": "onRunDescribeFinish",
"msg": "artifactsManager.onRunDescribeFinish({ name: 'Example' })",
"time": "2022-06-02T00:04:34.831Z",
"v": 0
},
{
"name": "ROOT_DESCRIBE_BLOCK",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "ArtifactsManager.js",
"level": 10,
"event": "ARTIFACTS_LIFECYCLE",
"fn": "onRunDescribeFinish",
"msg": "artifactsManager.onRunDescribeFinish({ name: 'ROOT_DESCRIBE_BLOCK' })",
"time": "2022-06-02T00:04:34.831Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "ArtifactsManager.js",
"level": 10,
"event": "ARTIFACTS_LIFECYCLE",
"fn": "onBeforeCleanup",
"msg": "artifactsManager.onBeforeCleanup()",
"time": "2022-06-02T00:04:34.855Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 reverse --remove tcp:64545",
"trackingId": 32,
"level": 10,
"event": "EXEC_SUCCESS",
"msg": "",
"time": "2022-06-02T00:04:34.857Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "ADBLogcatRecording",
"level": 10,
"event": "ARTIFACT_SAVE",
"msg": "saving ADBLogcatRecording to: artifacts/android.2022-06-02 00-04-07Z/emulator-19302 2022-06-02 00-04-34Z.startup.log",
"time": "2022-06-02T00:04:34.857Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "ADBLogcatRecording",
"level": 10,
"event": "ARTIFACT_STOP",
"msg": "stopping ADBLogcatRecording",
"time": "2022-06-02T00:04:34.858Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"date +\\\"%m-%d %T.000\\\"\"",
"trackingId": 33,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"date +\\\"%m-%d %T.000\\\"\"",
"time": "2022-06-02T00:04:34.858Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"date +\\\"%m-%d %T.000\\\"\"",
"trackingId": 33,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "06-01 17:04:31.000\n",
"time": "2022-06-02T00:04:34.924Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57769,
"__filename": "spawn.js",
"event": "SPAWN_KILL",
"level": 10,
"signal": "SIGINT",
"msg": "sending SIGINT to: /Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell logcat -T \"06-01 17:04:16.000\" --pid=6361 -f /sdcard/17411170_0.log",
"time": "2022-06-02T00:04:34.926Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "spawn.js",
"fn": "spawnAndLog",
"command": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell \"logcat -T \\\"06-01 17:04:16.000\\\" --pid=6361 -f /sdcard/17411170_0.log\"",
"trackingId": 30,
"cpid": 57769,
"level": 20,
"event": "SPAWN_END",
"signal": "SIGINT",
"code": null,
"msg": "/Users/brycek/Library/Android/sdk/platform-tools/adb -s emulator-19302 shell \"logcat -T \\\"06-01 17:04:16.000\\\" --pid=6361 -f /sdcard/17411170_0.log\" terminated with SIGINT",
"time": "2022-06-02T00:04:34.927Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 pull \"/sdcard/17411170_0.log\" \"artifacts/android.2022-06-02 00-04-07Z/emulator-19302 2022-06-02 00-04-34Z.startup.log\"",
"trackingId": 34,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 pull \"/sdcard/17411170_0.log\" \"artifacts/android.2022-06-02 00-04-07Z/emulator-19302 2022-06-02 00-04-34Z.startup.log\"",
"time": "2022-06-02T00:04:34.927Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 pull \"/sdcard/17411170_0.log\" \"artifacts/android.2022-06-02 00-04-07Z/emulator-19302 2022-06-02 00-04-34Z.startup.log\"",
"trackingId": 34,
"level": 10,
"event": "EXEC_SUCCESS",
"stdout": true,
"msg": "/sdcard/17411170_0.log: 1 file pulled, 0 skipped. 2.6 MB/s (11789 bytes in 0.004s)\n",
"time": "2022-06-02T00:04:34.970Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"rm \\\"/sdcard/17411170_0.log\\\"\"",
"trackingId": 35,
"level": 20,
"event": "EXEC_CMD",
"msg": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"rm \\\"/sdcard/17411170_0.log\\\"\"",
"time": "2022-06-02T00:04:34.971Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "exec.js",
"fn": "execWithRetriesAndLogs",
"cmd": "\"/Users/brycek/Library/Android/sdk/platform-tools/adb\" -s emulator-19302 shell \"rm \\\"/sdcard/17411170_0.log\\\"\"",
"trackingId": 35,
"level": 10,
"event": "EXEC_SUCCESS",
"msg": "",
"time": "2022-06-02T00:04:35.083Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_START",
"msg": "starting FileArtifact",
"time": "2022-06-02T00:04:35.085Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_STOP",
"msg": "stopping FileArtifact",
"time": "2022-06-02T00:04:35.085Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_SAVE",
"msg": "saving FileArtifact to: artifacts/android.2022-06-02 00-04-07Z/detox_pid_57698.json.log { append: true }",
"time": "2022-06-02T00:04:35.086Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_START",
"msg": "starting FileArtifact",
"time": "2022-06-02T00:04:35.086Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_STOP",
"msg": "stopping FileArtifact",
"time": "2022-06-02T00:04:35.086Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 10,
"event": "ARTIFACT_SAVE",
"msg": "saving FileArtifact to: artifacts/android.2022-06-02 00-04-07Z/detox_pid_57698.log { append: true }",
"time": "2022-06-02T00:04:35.086Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 20,
"event": "MOVE_FILE",
"msg": "moving \"/private/var/folders/dn/tmmbwlkd41l2_m5c4_6swjg80000gn/T/40ead527-8c1d-4349-a379-1f10945f0df4.detox.log\" to artifacts/android.2022-06-02 00-04-07Z/detox_pid_57698.json.log",
"time": "2022-06-02T00:04:35.087Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Artifact.js",
"class": "FileArtifact",
"level": 20,
"event": "MOVE_FILE",
"msg": "moving \"/private/var/folders/dn/tmmbwlkd41l2_m5c4_6swjg80000gn/T/eb26a370-bbf6-49ac-950a-67864db0e7e7.detox.log\" to artifacts/android.2022-06-02 00-04-07Z/detox_pid_57698.log",
"time": "2022-06-02T00:04:35.087Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "Client.js",
"level": 50,
"event": "APP_UNREACHABLE",
"msg": "Detox can't seem to connect to the test app(s)!\n\nHINT: \n\nThe test app might have crashed prematurely, or has had trouble setting up the connection.\nRefer to our troubleshooting guide, for full details: https://wix.github.io/Detox/docs/troubleshooting/running-tests#tests-execution-hangs \n\n\n",
"time": "2022-06-02T00:04:35.090Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "DetoxServer.js",
"level": 20,
"event": "WSS_CLOSE",
"msg": "Detox server has been closed gracefully",
"time": "2022-06-02T00:04:35.096Z",
"v": 0
},
{
"name": "detox",
"hostname": "[[hostname]]",
"pid": 57698,
"__filename": "DetoxSession.js",
"level": 10,
"event": "SESSION_TORN",
"msg": "tester exited session 5513f2e0-c8e1-a017-2eb2-30467f79a52b",
"time": "2022-06-02T00:04:35.110Z",
"v": 0
}
]
More data, please!
native/android/[[company]]/build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
maven { url "https://maven.fullstory.com" }
}
dependencies {
classpath 'com.android.tools:r8:3.1.51'
classpath 'com.android.tools.build:gradle:7.1.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-android-extensions:$kotlin_version"
classpath 'com.fullstory:gradle-plugin-local:1.22.1'
classpath "com.bugsnag:bugsnag-android-gradle-plugin:7.2.0"
}
}
ext {
reactnativeVersion = "0.66.4"
buildToolsVersion = "30.0.3"
compileSdkVersion = 31
targetSdkVersion = 31
minSdkVersion = 26
// Tell the io.invertase.gradle.build plugin where RN code lives.
// It doesn't find it automagically for some reason.
// https://github.com/invertase/react-native-gradle-plugin#auto-locate-and-add-react-native-as-a-dependency
set('react-native', [
options: [
reactNativeAndroidDir: "/../../../react-native/android"
]
])
}
allprojects {
repositories {
// This ensures all of Google's Android libraries are readily available
maven { url 'https://maven.google.com' }
mavenCentral()
}
}
apply from: "../root.gradle"
native/android/[[company]]/settings.gradle
import java.nio.file.Paths
include ':[[company]]'
include ':detox'
gradle.ext.[[project]]Root = Paths.get("$rootProject.projectDir/../../..").normalize().toString()
gradle.ext.[[project]]BundleInDebug = true
project(':detox').projectDir = new File(gradle.ext.[[project]]Root, './node_modules/detox/android/detox')
apply from: "../[[project]]-[[dependency]]/settings.gradle"
Sections of native/android/[[company]]/[[company]]/build.gradle
android {
defaultConfig {
// ...
// Detox
testBuildType System.getProperty('testBuildType', 'debug') // This will later be used to control the test apk build type
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
missingDimensionStrategy 'detox', 'full'
}
buildTypes {
debug {
// ...
}
release {
// ...
}
}
productFlavors {
dev {
// ...
}
internal {
// ...
}
}
// ...
// --------------------------------------------------------------------------------------------------
// Test dependencies follow.
// --------------------------------------------------------------------------------------------------
// JUnit. For unit testing. Duh.
testImplementation 'junit:junit:4.13.2'
// Kotlin support
testImplementation "org.jetbrains.kotlin:kotlin-test-junit:$kotlin_version"
testImplementation 'org.easymock:easymock:3.4'
testImplementation "org.mockito:mockito-core:3.6.0"
testImplementation 'androidx.test:core:1.4.0'
// Robolectric is used to impersonate Android SDK classes in command-line unit tests
testImplementation 'org.robolectric:robolectric:4.7.3'
// Replacement for Java's shitty built-in date library
testImplementation 'joda-time:joda-time:2.10.8'
// Detox
androidTestImplementation(project(path: ":detox"))
}
detoxrc.json
{
"testRunner": "jest",
"runnerConfig": "e2e/detox/config.json",
"skipLegacyWorkersInjection": true,
"apps": {
"ios": {
"type": "ios.app",
"binaryPath": "SPECIFY_PATH_TO_YOUR_APP_BINARY"
},
"android": {
"type": "android.apk",
"build": "(cd native/android/[[company]] && ./gradlew assembleInternalDebug assembleInternalDebugAndroidTest -DtestBuildType=debug)",
"binaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/internal/debug/[[company]]-internal-debug.apk",
"testBinaryPath": "native/android/[[company]]/[[company]]/build/outputs/apk/androidTest/internal/debug/[[company]]-internal-debug-androidTest.apk"
}
},
"devices": {
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 12 Pro Max"
}
},
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "Pixel_4_API_32"
}
}
},
"configurations": {
"ios": {
"device": "simulator",
"app": "ios"
},
"android": {
"device": "emulator",
"app": "android"
}
}
}
To be quite honest, I'm still pretty shaky about a lot of the configuration, but I've worked with our team's Android engineer to make sure things are in alignment. When I run the build command, both .apks are created correctly. When I run the test, detox correctly uninstalls and then reinstalls the .apk.
Thanks for your help in advance!
We have a similar issue. Tests used to work, but haven't been ran in a while.
We upgraded a few RN versions since they were last known to work.
I notice that there's a native crash logged in Flipper:
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
I'm not sure why libjscexecutor.so
is attempted to be loaded, because the app uses hermes. Something must be wrong with the gradle config.
@BBKolton I suggest looking at your native crash logs.
@andreialecu I've met the same. Didn't actualize e2e test in teh app for ages.
On this week I decided to update react and Detox. Now I got the same in native logs
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
downgrade to classpath 'com.android.tools.build:gradle:7.0.4' as described in react-native current template helped me
downgrade to classpath 'com.android.tools.build:gradle:7.0.4' as described in react-native current template helped me
Didn't work for me coz I already was on 7.0.4. I tried downgrading to 4.1.0. No effect.
I am on react native 0.68 and I am not using the compiling dependency setup (I also tried it but with no effect neither). I have the same error message.
downgrade to classpath 'com.android.tools.build:gradle:7.0.4' as described in react-native current template helped me
Didn't work for me coz I already was on 7.0.4. I tried downgrading to 4.1.0. No effect.
I am on react native 0.68 and I am not using the compiling dependency setup (I also tried it but with no effect neither). I have the same error message.
I have another project in which the tests are running, and this error also happens so it is not the reason why it is not working.
Same after upgrade to react-native 0.68
assembled app with ./gradlew assembleDebug
runs with no issues, but when I run it with detox test
, app crash with logs
java.lang.UnsatisfiedLinkError: couldn't find DSO to load: libjscexecutor.so
Same here "react-native": "0.68.2", "detox": "^19.1.1", Stopped working after upgrade of react native from 0.67.*
@BBKolton,
Question 1:
As for the test Java class, since Detox is set as a compiling dependency, I do not have a custom class file in the android/src folder
Does this mean you don't have the DetoxTest.java file set up? Because you should have, regardless of whether or not you're compiling Detox.
Question 2: Why not work with Detox prebuilt?
Question 3: Your app crashes and fails to launch. Could you try to look up the error under adb logcat
?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe the issue is still relevant, please test on the latest Detox and report back.
Thank you for your contributions!
For more information on bots in this reporsitory, read this discussion.
The issue has been closed for inactivity.
@d4vidi - wow thanks for your comment here.
Somehow I'd added a typo to the folder structure containing DetoxTest.js. I'd written "jave" instead of "java" 🤦
That is a few hours of my life that I'll never get back...
This thread was really hard to find - I went down a lot of wild goose chases form other similar threads. I wonder if failing the build, or a better runtime error may be able to help here? Obviously this is my own stupid mistake, but it is easy to put a file in the wrong place or misspell a filename.