Detox
Detox copied to clipboard
Tests fail to run
Description
I have gotten tests to run once and all fail as they were written. Now no test runs and I don't know why.
I am following the instructions but I'm getting an error: detox[1796] ERROR: [APP_UNREACHABLE] Detox can't seem to connect to the test app(s)!
Here is my testing file, loginTest.e2e.js:
describe('Login', () => {
beforeAll(async () => {
await device.launchApp();
});
beforeEach(async () => {
await device.reloadReactNative();
});
it('should show login components', async () => {
await expect(element(by.id('user_login_btn'))).toBeVisible();
// await expect(element(by.id('clear_user_login_btn'))).toBeVisible();
// await expect(element(by.id('user_name'))).toBeVisible();
// await expect(element(by.id('user_password'))).toBeVisible();
});
// it('should show hello screen after tap', async () => {
// await element(by.id('hello_button')).tap();
// await expect(element(by.text('Hello!!!'))).toBeVisible();
// });
// it('should show world screen after tap', async () => {
// await element(by.id('world_button')).tap();
// await expect(element(by.text('World!!!'))).toBeVisible();
// });
});
I have two powershell terminals open, one running react-native the other for Detox building and testing. The app closes, is deleted, but doesn't open and if I try to open it manually while a test is running it will simply hang on a white screen until the timeout value is reached. Extending the timeout value was not helpful. I can start the app normally if Detox is not running.
There is a similar question but I'm not sure how to use it or if I can since I don't use Flipper and I'm not sure where the file referenced in the post is and how it would need to be edited if I could find the file. The error codes are different so I'm not confident that the fix would work.
Here is my .detoxrc.json file:
{
"testRunner": "jest",
"runnerConfig": "e2e/config.json",
"skipLegacyWorkersInjection": true,
"apps": {
"ios": {
"type": "ios.app",
"binaryPath": "SPECIFY_PATH_TO_YOUR_APP_BINARY"
},
"android": {
"type": "android.apk",
"binaryPath": "android\\app\\build\\outputs\\apk\\debug\\app-debug.apk",
"build": "cd android && .\\gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug || cd .."
}
},
"devices": {
"simulator": {
"type": "ios.simulator",
"device": {
"type": "iPhone 11"
}
},
"emulator": {
"type": "android.emulator",
"device": {
"avdName": "4_WVGA_Nexus_S_API_28"
}
}
},
"configurations": {
"ios": {
"device": "simulator",
"app": "ios"
},
"android": {
"device": "emulator",
"app": "android"
}
}
}
Clearing the cache, npx react-native start --reset-cache`, has not helped.
Your environment
Detox version: 19.7.1 React Native version: 0.68.1 Node version: 16.14.2 Device model: 4 WVGA (Nexus S) API 28 - emulator OS: Windows 10 10.0.19043 Test-runner (select one): jest-circus
I see there is a helpful suggestion to troubleshoot, but when I follow the instructions to "Create a Detox-Test Class" i get many errors including Cannot resolve symbol 'wix'. I have double checked the package names, and directory names, and MainActivity is the same. What else do I need to do to restore functionality?
@jinhale Could you please run adb logcat to see whether there is relevant info in the native logs that could help? Also, could you try to run the detox test command with -l verbose to see whether it provides us with additional information?
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.
@jinhale is it still happens for you? Have you tried to check the logs as Jonathan suggested?
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.
@jinhale is it still happens for you? Have you tried to check the logs as Jonathan suggested?
PS C:\Users\jhale\AwesomeProject> detox test --configuration android -l verbose 12:24:26.508 detox[11016] INFO: [test.js] DETOX_CONFIGURATION="android" DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1664900666494 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern "^((?!:ios:).)*$" e2e 12:24:29.674 detox[18264] DEBUG: [WSS_CREATE] Detox server listening on localhost:58166... 12:24:29.700 detox[18264] DEBUG: [WSS_CONNECTION, #58167] registered a new connection. 12:24:29.832 detox[18264] DEBUG: [EXEC_CMD, #0] "C:\Users\jhale\AppData\Local\Android\Sdk\emulator\emulator.EXE" -list-avds --verbose 12:24:29.880 detox[18264] DEBUG: [EXEC_CMD, #1] "C:\Users\jhale\AppData\Local\Android\Sdk\emulator\emulator.EXE" -version 12:24:30.139 detox[18264] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 2, patch: 10, toString: [Function: toString] } 12:24:30.141 detox[18264] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "4_WVGA_Nexus_S_API_28" 12:24:30.145 detox[18264] DEBUG: [EXEC_CMD, #2] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" devices 12:24:30.189 detox[18264] DEBUG: [EXEC_SUCCESS, #2] List of devices attached emulator-5554 device
12:24:30.202 detox[18264] DEBUG: [DEVICE_LOOKUP] Found a matching & free device emulator-5554 12:24:30.206 detox[18264] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-5554 12:24:30.208 detox[18264] DEBUG: [EXEC_CMD, #3] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "getprop dev.bootcomplete" 12:24:30.281 detox[18264] DEBUG: [EXEC_CMD, #4] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "getprop ro.build.version.sdk" 12:24:30.346 detox[18264] DEBUG: [EXEC_CMD, #5] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "settings put global animator_duration_scale 0" 12:24:30.413 detox[18264] DEBUG: [EXEC_CMD, #6] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "settings put global window_animation_scale 0" 12:24:30.481 detox[18264] DEBUG: [EXEC_CMD, #7] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "settings put global transition_animation_scale 0" 12:24:30.546 detox[18264] DEBUG: [EXEC_CMD, #8] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "dumpsys power | grep "^[ ]m[UW].="" 12:24:30.670 detox[18264] DEBUG: [EXEC_CMD, #9] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump badging "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" 12:24:30.833 detox[18264] DEBUG: [EXEC_CMD, #10] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "am force-stop com.awesomeproject" 12:24:30.913 detox[18264] DEBUG: [EXEC_CMD, #11] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "pm list packages com.awesomeproject" 12:24:30.981 detox[18264] DEBUG: [EXEC_CMD, #12] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 uninstall com.awesomeproject 12:24:31.190 detox[18264] DEBUG: [EXEC_CMD, #13] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "pm list packages com.awesomeproject.test" 12:24:31.341 detox[18264] DEBUG: [EXEC_CMD, #14] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "am force-stop com.awesomeproject" 12:24:31.488 detox[18264] DEBUG: [EXEC_CMD, #15] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump xmlstrings "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" AndroidManifest.xml 12:24:31.529 detox[18264] DEBUG: [EXEC_CMD, #16] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump xmlstrings "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk" AndroidManifest.xml 12:24:31.578 detox[18264] DEBUG: [EXEC_CMD, #17] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "rm -fr /data/local/tmp/detox" 12:24:31.655 detox[18264] DEBUG: [EXEC_CMD, #18] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 shell "mkdir -p /data/local/tmp/detox" 12:24:31.744 detox[18264] DEBUG: [EXEC_CMD, #19] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 push "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" "/data/local/tmp/detox/Application.apk" 12:24:32.509 detox[18264] DEBUG: [SPAWN_CMD, #20, cpid=4204] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk 12:24:33.810 detox[18264] DEBUG: [SPAWN_END, #20, cpid=4204] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0 12:24:33.811 detox[18264] DEBUG: [EXEC_CMD, #21] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-5554 push "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk" 12:24:33.901 detox[18264] DEBUG: [SPAWN_CMD, #22, cpid=19740] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk 12:24:34.149 detox[18264] DEBUG: [SPAWN_END, #22, cpid=19740] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-5554 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0 12:24:34.169 detox[18264] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully
@jinhale Could you please run
adb logcatto see whether there is relevant info in the native logs that could help? Also, could you try to run the detox test command with-l verboseto see whether it provides us with additional information?
I stopped running logcat at 94,789 lines and a couple of hours of runtime.
Here is the result when I try to load the test without having an emulator open first:
PS C:\Users\jhale\AwesomeProject> detox test --configuration android -l verbose 08:55:51.839 detox[4260] INFO: [test.js] DETOX_CONFIGURATION="android" DETOX_LOGLEVEL="verbose" DETOX_REPORT_SPECS=true DETOX_START_TIMESTAMP=1664974551824 DETOX_USE_CUSTOM_LOGGER=true jest --config e2e/config.json --testNamePattern "^((?!:ios:).)*$" e2e 08:55:55.746 detox[3668] DEBUG: [WSS_CREATE] Detox server listening on localhost:58982... 08:55:55.802 detox[3668] DEBUG: [WSS_CONNECTION, #58983] registered a new connection. 08:55:55.980 detox[3668] DEBUG: [EXEC_CMD, #0] "C:\Users\jhale\AppData\Local\Android\Sdk\emulator\emulator.EXE" -list-avds --verbose 08:55:56.115 detox[3668] DEBUG: [EXEC_CMD, #1] "C:\Users\jhale\AppData\Local\Android\Sdk\emulator\emulator.EXE" -version 08:55:56.768 detox[3668] DEBUG: [EMU_BIN_VERSION_DETECT] Detected emulator binary version { major: 31, minor: 2, patch: 10, toString: [Function: toString] } 08:55:56.770 detox[3668] DEBUG: [ALLOCATE_DEVICE] Trying to allocate a device based on "4_WVGA_Nexus_S_API_28" 08:55:56.774 detox[3668] DEBUG: [EXEC_CMD, #2] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" devices 08:55:56.819 detox[3668] DEBUG: [EXEC_SUCCESS, #2] List of devices attached
08:55:56.824 detox[3668] DEBUG: [ALLOCATE_DEVICE] Settled on emulator-19186 08:55:56.828 detox[3668] DEBUG: [SPAWN_CMD] C:\Users\jhale\AppData\Local\Android\Sdk\emulator\emulator.EXE -verbose -no-audio -no-boot-anim -port 19186 @4_WVGA_Nexus_S_API_28 08:56:04.354 detox[3668] DEBUG: [SPAWN_SUCCESS] WARNING | cannot add library vulkan-1.dll: failed WARNING | cannot add library vulkan-1.dll: failed VERBOSE | autoconfig: -skin 480x800 VERBOSE | autoconfig: -skindir (null) VERBOSE | autoconfig: -kernel C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\kernel-ranchu-64 VERBOSE | Target arch = 'x86' VERBOSE | Auto-config: -qemu -cpu qemu32 VERBOSE | querying file version info API... VERBOSE | found kernelbase.dll VERBOSE | GetFileVersionInfoSizeW found. On Windows 10? VERBOSE | GetFileVersionInfoW found. On Windows 10? VERBOSE | VerQueryValueW found. Can query file versions VERBOSE | queryFileVersionInfo: path not found: amdvlk64.dll VERBOSE | querying file version info API... VERBOSE | queryFileVersionInfo: path not found: amdvlk32.dll VERBOSE | querying file version info API... VERBOSE | queryFileVersionInfo: path not found: vulkan-1.dll VERBOSE | Auto-detect: Kernel image requires new device naming scheme. VERBOSE | Auto-detect: Kernel does not support YAFFS2 partitions. VERBOSE | autoconfig: -ramdisk C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\ramdisk.img VERBOSE | Using initial system image: C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\system.img VERBOSE | Using initial vendor image: C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\vendor.img VERBOSE | autoconfig: -data C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\userdata-qemu.img VERBOSE | autoconfig: -initdata C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\userdata.img VERBOSE | autoconfig: -cache C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\cache.img VERBOSE | autoconfig: -sdcard C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\sdcard.img VERBOSE | Increasing RAM size to 1536MB VERBOSE | VM heap size 48MB is below hardware specified minimum of 384MB,setting it to that value VERBOSE | System image is read only VERBOSE | Found 4 DNS servers: VERBOSE | 192.168.1.1 VERBOSE | 172.16.254.4 VERBOSE | fec0:0:0:ffff::1 VERBOSE | fec0:0:0:ffff::2 VERBOSE | found magic skin width=480 height=800 bpp=16
VERBOSE | Requested console port 19186: Inferring adb port 19187. VERBOSE | Checking whether Windows Hypervisor Platform (WHPX) is available. VERBOSE | WinHvPlatform.dll found. Looking for WHvGetCapability... VERBOSE | WHvGetCapability found. Querying WHPX capabilities... VERBOSE | WHPX (10.0.19043) is installed and usable. VERBOSE | CPU Acceleration: working VERBOSE | CPU Acceleration status: Please disable Hyper-V before using the Android Emulator. Start a command prompt as Administrator, run 'bcdedit /set hypervisorlaunchtype off', reboot.WHPX (10.0.19043) is installed and usable. VERBOSE | handleCpuAcceleration: feature check for hvf VERBOSE | registered 'boot-properties' qemud service VERBOSE | Adding boot property: 'qemu.cmdline' = 'androidboot.logcat=*:V androidboot.consolepipe=qemu_pipe,pipe:logcat' VERBOSE | Adding boot property: 'qemu.logcat' = 'start' VERBOSE | GPU emulation enabled using 'swiftshader_indirect' mode VERBOSE | Initializing hardware OpenGLES emulation support VERBOSE | create display 0 VERBOSE | setDisplayPose 0 x 0 y 0 w 480 h 800 dpi 0 INFO | configAndStartRenderer: setting vsync to 60 hz VERBOSE | Found 4 DNS servers: VERBOSE | 192.168.1.1 VERBOSE | 172.16.254.4 VERBOSE | fec0:0:0:ffff::1 VERBOSE | fec0:0:0:ffff::2 INFO | Content of hardware configuration file: INFO | hw.cpu.arch = x86 INFO | hw.cpu.model = qemu32 INFO | hw.cpu.ncore = 4 INFO | hw.ramSize = 1536 INFO | hw.screen = multi-touch INFO | hw.mainKeys = true INFO | hw.trackBall = false INFO | hw.keyboard = true INFO | hw.keyboard.lid = false INFO | hw.keyboard.charmap = qwerty2 INFO | hw.dPad = false INFO | hw.rotaryInput = false INFO | hw.gsmModem = true INFO | hw.gps = true INFO | hw.battery = true INFO | hw.accelerometer = true INFO | hw.gyroscope = true INFO | hw.audioInput = true INFO | hw.audioOutput = true INFO | hw.sdCard = true INFO | hw.sdCard.path = C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\sdcard.img INFO | disk.cachePartition = true INFO | disk.cachePartition.path = C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\cache.img INFO | disk.cachePartition.size = 66m INFO | test.quitAfterBootTimeOut = -1 INFO | test.delayAdbTillBootComplete = 0 INFO | test.monitorAdb = 0 INFO | hw.lcd.width = 480 INFO | hw.lcd.height = 800 INFO | hw.lcd.depth = 16 INFO | hw.lcd.density = 240 INFO | hw.lcd.backlight = true INFO | hw.lcd.vsync = 60 INFO | hw.gltransport = pipe INFO | hw.gltransport.asg.writeBufferSize = 1048576 INFO | hw.gltransport.asg.writeStepSize = 4096 INFO | hw.gltransport.asg.dataRingSize = 32768 INFO | hw.gltransport.drawFlushInterval = 800 INFO | hw.displayRegion.0.1.xOffset = -1 INFO | hw.displayRegion.0.1.yOffset = -1 INFO | hw.displayRegion.0.1.width = 0 INFO | hw.displayRegion.0.1.height = 0 INFO | hw.displayRegion.0.2.xOffset = -1 INFO | hw.displayRegion.0.2.yOffset = -1 INFO | hw.displayRegion.0.2.width = 0 INFO | hw.displayRegion.0.2.height = 0 INFO | hw.displayRegion.0.3.xOffset = -1 INFO | hw.displayRegion.0.3.yOffset = -1 INFO | hw.displayRegion.0.3.width = 0 INFO | hw.displayRegion.0.3.height = 0 INFO | hw.display1.width = 0 INFO | hw.display1.height = 0 INFO | hw.display1.density = 0 INFO | hw.display1.xOffset = -1 INFO | hw.display1.yOffset = -1 INFO | hw.display1.flag = 0 INFO | hw.display2.width = 0 INFO | hw.display2.height = 0 INFO | hw.display2.density = 0 INFO | hw.display2.xOffset = -1 INFO | hw.display2.yOffset = -1 INFO | hw.display2.flag = 0 INFO | hw.display3.width = 0 INFO | hw.display3.height = 0 INFO | hw.display3.density = 0 INFO | hw.display3.xOffset = -1 INFO | hw.display3.yOffset = -1 INFO | hw.display3.flag = 0 INFO | hw.gpu.enabled = true INFO | hw.gpu.mode = swiftshader_indirect INFO | hw.initialOrientation = Portrait INFO | hw.camera.back = virtualscene INFO | hw.camera.front = emulated INFO | vm.heapSize = 384 INFO | hw.sensors.light = true INFO | hw.sensors.pressure = true INFO | hw.sensors.humidity = true INFO | hw.sensors.proximity = true INFO | hw.sensors.magnetic_field = true INFO | hw.sensors.magnetic_field_uncalibrated = true INFO | hw.sensors.gyroscope_uncalibrated = true INFO | hw.sensors.orientation = true INFO | hw.sensors.temperature = true INFO | hw.sensors.rgbclight = false INFO | hw.sensor.hinge = false INFO | hw.sensor.hinge.count = 0 INFO | hw.sensor.hinge.type = 0 INFO | hw.sensor.hinge.sub_type = 0 INFO | hw.sensor.hinge.fold_to_displayRegion.0.1_at_posture = 1 INFO | hw.sensor.roll = false INFO | hw.sensor.roll.count = 0 INFO | hw.sensor.roll.resize_to_displayRegion.0.1_at_posture = 6 INFO | hw.sensor.roll.resize_to_displayRegion.0.2_at_posture = 6 INFO | hw.sensor.roll.resize_to_displayRegion.0.3_at_posture = 6 INFO | hw.sensors.heart_rate = false INFO | hw.sensors.wrist_tilt = false INFO | hw.useext4 = true INFO | hw.arc = false INFO | hw.arc.autologin = false INFO | hw.device.name = 4in WVGA (Nexus S) INFO | kernel.path = C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\kernel-ranchu-64 INFO | kernel.newDeviceNaming = yes INFO | kernel.supportsYaffs2 = no INFO | disk.ramdisk.path = C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\ramdisk.img INFO | disk.systemPartition.initPath = C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\system.img INFO | disk.systemPartition.size = 2562m INFO | disk.vendorPartition.initPath = C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\vendor.img INFO | disk.vendorPartition.size = 800m INFO | disk.dataPartition.path = C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\userdata-qemu.img INFO | disk.dataPartition.size = 800m INFO | disk.encryptionKeyPartition.path = C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\encryptionkey.img INFO | PlayStore.enabled = false INFO | avd.name = 4_WVGA_Nexus_S_API_28 INFO | avd.id = 4_WVGA_Nexus_S_API_28 INFO | fastboot.forceColdBoot = false INFO | android.sdk.root = C:\Users\jhale\AppData\Local\Android\Sdk INFO | android.avd.home = C:\Users\jhale.android\avd INFO | . INFO | QEMU options list: INFO | argv[00] = "C:\Users\jhale\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe" INFO | argv[01] = "-dns-server" INFO | argv[02] = "192.168.1.1,172.16.254.4,fec0:0:0:ffff::1,fec0:0:0:ffff::2" INFO | argv[03] = "-no-audio" INFO | argv[04] = "-mem-path" INFO | argv[05] = "C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\snapshots\default_boot\ram.img" INFO | argv[06] = "-mem-file-shared" INFO | argv[07] = "-serial" INFO | argv[08] = "null" INFO | argv[09] = "-android-ports" INFO | argv[10] = "19186,19187" INFO | argv[11] = "-device" INFO | argv[12] = "goldfish_pstore,addr=0xff018000,size=0x10000,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\data\misc\pstore\pstore.bin" INFO | argv[13] = "-cpu" INFO | argv[14] = "android64" INFO | argv[15] = "-enable-whpx" INFO | argv[16] = "-smp" INFO | argv[17] = "cores=4" INFO | argv[18] = "-m" INFO | argv[19] = "1536" INFO | argv[20] = "-lcd-density" INFO | argv[21] = "240" INFO | argv[22] = "-nodefaults" INFO | argv[23] = "-kernel" INFO | argv[24] = "C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\kernel-ranchu-64" INFO | argv[25] = "-initrd" INFO | argv[26] = "C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\ramdisk.img" INFO | argv[27] = "-drive" INFO | argv[28] = "if=none,index=0,id=system,if=none,file=C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\system.img,read-only" INFO | argv[29] = "-device" INFO | argv[30] = "virtio-blk-pci,drive=system,modern-pio-notify" INFO | argv[31] = "-drive" INFO | argv[32] = "if=none,index=1,id=cache,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576" INFO | argv[33] = "-device" INFO | argv[34] = "virtio-blk-pci,drive=cache,modern-pio-notify" INFO | argv[35] = "-drive" INFO | argv[36] = "if=none,index=2,id=userdata,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576" INFO | argv[37] = "-device" INFO | argv[38] = "virtio-blk-pci,drive=userdata,modern-pio-notify" INFO | argv[39] = "-drive" INFO | argv[40] = "if=none,index=3,id=encrypt,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576" INFO | argv[41] = "-device" INFO | argv[42] = "virtio-blk-pci,drive=encrypt,modern-pio-notify" INFO | argv[43] = "-drive" INFO | argv[44] = "if=none,index=4,id=vendor,if=none,file=C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\vendor.img,read-only" INFO | argv[45] = "-device" INFO | argv[46] = "virtio-blk-pci,drive=vendor,modern-pio-notify" INFO | argv[47] = "-drive" INFO | argv[48] = "if=none,index=5,id=sdcard,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\sdcard.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576" INFO | argv[49] = "-device" INFO | argv[50] = "virtio-blk-pci,drive=sdcard,modern-pio-notify" INFO | argv[51] = "-netdev" INFO | argv[52] = "user,id=mynet" INFO | argv[53] = "-device" INFO | argv[54] = "virtio-net-pci,netdev=mynet" INFO | argv[55] = "-device" INFO | argv[56] = "virtio-rng-pci" INFO | argv[57] = "-show-cursor" INFO | argv[58] = "-L" INFO | argv[59] = "C:\Users\jhale\AppData\Local\Android\Sdk\emulator/lib/pc-bios" INFO | argv[60] = "-soundhw" INFO | argv[61] = "hda" INFO | argv[62] = "-vga" INFO | argv[63] = "none" INFO | argv[64] = "-append" INFO | argv[65] = "no_timer_check clocksource=pit no-kvmclock console=0 cma=262M@0-4G ndns=4 mac80211_hwsim.radios=2 mac80211_hwsim.channels=2 skip_initramfs rootwait ro init=/init loop.max_part=7 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10000$0xff018000 printk.devkmsg=on qemu=1 androidboot.hardware=ranchu androidboot.serialno=EMULATOR31X2X10X0 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl qemu.dalvik.vm.heapsize=384m qemu.camera_hq_edge_processing=0 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ dm="1 vroot none ro 1,0 5159992 verity 1 PARTUUID=CCBCABD5-6445-412D-A10F-2F74DBBACCD1 PARTUUID=CCBCABD5-6445-412D-A10F-2F74DBBACCD1 4096 4096 644999 644999 sha1 0011390ef3aa44087ea27d0e16a4107410518496 7e1037d90feb2438fcc16ac51c9aca000bcf6746 1 ignore_zero_blocks" androidboot.veritymode=enforcing androidboot.verifiedbootstate=orange root=/dev/dm-0 qemu.wifi=1 android.qemud=1 qemu.avd_name=4_WVGA_Nexus_S_API_28" INFO | argv[66] = "-android-hw" INFO | argv[67] = "C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\hardware-qemu.ini" INFO | Concatenated QEMU options: C:\Users\jhale\AppData\Local\Android\Sdk\emulator\qemu\windows-x86_64\qemu-system-x86_64.exe -dns-server 192.168.1.1,172.16.254.4,fec0:0:0:ffff::1,fec0:0:0:ffff::2 -no-audio -mem-path C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\snapshots\default_boot\ram.img -mem-file-shared -serial null -android-ports 19186,19187 -device goldfish_pstore,addr=0xff018000,size=0x10000,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\data\misc\pstore\pstore.bin -cpu android64 -enable-whpx -smp cores=4 -m 1536 -lcd-density 240 -nodefaults -kernel C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\kernel-ranchu-64 -initrd C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\ramdisk.img -drive if=none,index=0,id=system,if=none,file=C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\system.img,read-only -device virtio-blk-pci,drive=system,modern-pio-notify -drive if=none,index=1,id=cache,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\cache.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=cache,modern-pio-notify -drive if=none,index=2,id=userdata,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\userdata-qemu.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=userdata,modern-pio-notify -drive if=none,index=3,id=encrypt,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\encryptionkey.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=encrypt,modern-pio-notify -drive if=none,index=4,id=vendor,if=none,file=C:\Users\jhale\AppData\Local\Android\Sdk\system-images\android-28\google_apis\x86\vendor.img,read-only -device virtio-blk-pci,drive=vendor,modern-pio-notify -drive if=none,index=5,id=sdcard,if=none,file=C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\sdcard.img.qcow2,overlap-check=none,cache=unsafe,l2-cache-size=1048576 -device virtio-blk-pci,drive=sdcard,modern-pio-notify -netdev user,id=mynet -device virtio-net-pci,netdev=mynet -device virtio-rng-pci -show-cursor -L C:\Users\jhale\AppData\Local\Android\Sdk\emulator/lib/pc-bios -soundhw hda -vga none -append "no_timer_check clocksource=pit no-kvmclock console=0 cma=262M@0-4G ndns=4 mac80211_hwsim.radios=2 mac80211_hwsim.channels=2 skip_initramfs rootwait ro init=/init loop.max_part=7 ramoops.mem_address=0xff018000 ramoops.mem_size=0x10000 memmap=0x10ERROR | Failed to open /qemu.conf, err: 2 000$0xff018000 printk.devkmsg=on qemu=1 androidboot.hardware=ranchu androidboot.serialno=EMULATOR31X2X10X0 android.bootanim=0 qemu.gles=1 qemu.settings.system.screen_off_timeout=2147483647 qemu.encrypt=1 qemu.vsync=60 qemu.gltransport=pipe qemu.gltransport.drawFlushInterval=800 qemu.opengles.version=196608 qemu.uirenderer=skiagl qemu.dalvik.vm.heapsize=384m qemu.camera_hq_edge_processing=0 androidboot.android_dt_dir=/sys/bus/platform/devices/ANDR0001:00/properties/android/ dm="1 vroot none ro 1,0 5159992 verity 1 PARTUUID=CCBCABD5-6445-412D-A10F-2F74DBBACCD1 PARTUUID=CCBCABD5-6445-412D-A10F-2F74DBBACCD1 4096 4096 644999 644999 sha1 0011390ef3aa44087ea27d0e16a4107410518496 7e1037d90feb2438fcc16ac51c9aca000bcf6746 1 ignore_zero_blocks" androidboot.veritymode=enforcing androidboot.verifiedbootstate=orange root=/dev/dm-0 qemu.wifi=1 android.qemud=1 qemu.avd_name=4_WVGA_Nexus_S_API_28" -android-hw C:\Users\jhale.android\avd\4_WVGA_Nexus_S_API_28.avd\hardware-qemu.ini INFO | added library C:\Users\jhale\AppData\Local\Android\Sdk\emulator\lib64\vulkan\vulkan-1.dll VERBOSE | Android qemu version 31.2.10.0 (build_id 8420304) (CL:N/A) VERBOSE | Starting QEMU main loop VERBOSE | Adding boot property: 'ro.opengles.version' = '196608' VERBOSE | Adding boot property: 'qemu.sf.fake_camera' = 'front' VERBOSE | Adding boot property: 'dalvik.vm.heapsize' = '384m' VERBOSE | Adding boot property: 'qemu.hw.mainkeys' = '1' VERBOSE | Adding boot property: 'qemu.sf.lcd_density' = '240' WHPX on Windows 10.0.19043 detected. Windows Hypervisor Platform accelerator is operational VERBOSE | goldfish_events.have-dpad: false VERBOSE | goldfish_events.have-trackball: false VERBOSE | goldfish_events.have-camera: true VERBOSE | goldfish_events.have-keyboard: true VERBOSE | goldfish_events.have-lidswitch: false VERBOSE | goldfish_events.have-tabletmode: false VERBOSE | goldfish_events.have-touch: false VERBOSE | goldfish_events.have-multitouch: true WARNING | Requested adb port (19187) is outside the recommended range [5555,5586]. ADB may not function properly for the emulator. See -help-port for details. VERBOSE | Not using any http proxy VERBOSE | Adding boot property: 'qemu.timezone' = 'America/New_York' VERBOSE | android_hw_fingerprint_init: fingerprint qemud listen service initialized VERBOSE | emulator_window_fb_rotate VERBOSE | No acpi ini file provided, using default VERBOSE | OpenGL Vendor=[Google (Google Inc.)] VERBOSE | OpenGL Renderer=[Android Emulator OpenGL ES Translator (Google SwiftShader)] VERBOSE | OpenGL Version=[OpenGL ES 3.0 (OpenGL ES 3.0 SwiftShader 4.0.0.1)] VERBOSE | No acpi ini file provided, using default INFO | Your emulator is out of date, please update by launching Android Studio:
- Start Android Studio
- Select menu "Tools > Android > SDK Manager"
- Click "SDK Tools" tab
- Check "Android Emulator" checkbox
- Click "OK"
VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | Found: 3 adb executables VERBOSE | Adb: C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe VERBOSE | Adb: C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe VERBOSE | Adb: C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | Path:C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.exe protocol version: 41 VERBOSE | onGuestSendCommand: [000002470A64E110] Adb connected, start proxing data
08:56:04.388 detox[3668] DEBUG: [EXEC_CMD, #3] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "getprop dev.bootcomplete" 08:56:06.984 detox[3668] DEBUG: [EXEC_CMD, #4] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "getprop dev.bootcomplete" 08:56:12.065 detox[3668] DEBUG: [EXEC_CMD, #5] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "getprop dev.bootcomplete" 08:56:19.675 detox[3668] DEBUG: [EXEC_CMD, #6] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "getprop dev.bootcomplete" 08:56:19.862 detox[3668] DEBUG: [EXEC_CMD, #7] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "getprop ro.build.version.sdk" 08:56:20.115 detox[3668] DEBUG: [EXEC_CMD, #8] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "settings put global animator_duration_scale 0" 08:56:20.599 detox[3668] DEBUG: [EXEC_CMD, #9] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "settings put global window_animation_scale 0" 08:56:20.858 detox[3668] DEBUG: [EXEC_CMD, #10] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "settings put global transition_animation_scale 0" 08:56:21.016 detox[3668] DEBUG: [EXEC_CMD, #11] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "dumpsys power | grep "^[ ]m[UW].="" 08:56:21.312 detox[3668] DEBUG: [EXEC_CMD, #12] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump badging "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" 08:56:21.560 detox[3668] DEBUG: [EXEC_CMD, #13] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "am force-stop com.awesomeproject" 08:56:21.955 detox[3668] DEBUG: [EXEC_CMD, #14] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "pm list packages com.awesomeproject" 08:56:22.141 detox[3668] DEBUG: [EXEC_CMD, #15] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 uninstall com.awesomeproject 08:56:23.129 detox[3668] DEBUG: [EXEC_CMD, #16] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "pm list packages com.awesomeproject.test" 08:56:23.315 detox[3668] DEBUG: [EXEC_CMD, #17] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 uninstall com.awesomeproject.test 08:56:23.938 detox[3668] DEBUG: [EXEC_CMD, #18] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "am force-stop com.awesomeproject" 08:56:24.139 detox[3668] DEBUG: [EXEC_CMD, #19] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump xmlstrings "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" AndroidManifest.xml 08:56:24.269 detox[3668] DEBUG: [EXEC_CMD, #20] "C:\Users\jhale\AppData\Local\Android\Sdk\build-tools\32.1.0-rc1\aapt.EXE" dump xmlstrings "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk" AndroidManifest.xml 08:56:24.374 detox[3668] DEBUG: [EXEC_CMD, #21] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "rm -fr /data/local/tmp/detox" 08:56:24.529 detox[3668] DEBUG: [EXEC_CMD, #22] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 shell "mkdir -p /data/local/tmp/detox" 08:56:24.697 detox[3668] DEBUG: [EXEC_CMD, #23] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 push "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\debug\app-debug.apk" "/data/local/tmp/detox/Application.apk" 08:56:25.697 detox[3668] DEBUG: [SPAWN_CMD, #24, cpid=17736] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-19186 shell pm install -r -g -t /data/local/tmp/detox/Application.apk 08:56:28.569 detox[3668] DEBUG: [SPAWN_END, #24, cpid=17736] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-19186 shell pm install -r -g -t /data/local/tmp/detox/Application.apk exited with code #0 08:56:28.571 detox[3668] DEBUG: [EXEC_CMD, #25] "C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE" -s emulator-19186 push "C:\Users\jhale\AwesomeProject\android\app\build\outputs\apk\androidTest\debug\app-debug-androidTest.apk" "/data/local/tmp/detox/Test.apk" 08:56:28.708 detox[3668] DEBUG: [SPAWN_CMD, #26, cpid=20104] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-19186 shell pm install -r -g -t /data/local/tmp/detox/Test.apk 08:56:29.231 detox[3668] DEBUG: [SPAWN_END, #26, cpid=20104] C:\Users\jhale\AppData\Local\Android\Sdk\platform-tools\adb.EXE -s emulator-19186 shell pm install -r -g -t /data/local/tmp/detox/Test.apk exited with code #0 08:56:29.262 detox[3668] DEBUG: [WSS_CLOSE] Detox server has been closed gracefully FAIL e2e/firstTest.e2e.js ● Test suite failed to run
TypeError: Cannot read properties of undefined (reading 'enableGlobally')
at jestAdapter (../node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js:39:25)
08:56:29.474 detox[4260] ERROR: [cli.js] Command failed: jest --config e2e/config.json --testNamePattern "^((?!:ios:).)*$" e2e
Following the upgrade advise didn't help. I was able to upgrade the emulator and I restarted Android Studio to no good effect. I'm using a version of Android Studio downloaded yesterday:
Android Studio Bumblebee | 2021.1.1 Patch 3 Build #AI-211.7628.21.2111.8309675, built on March 16, 2022 Runtime version: 11.0.11+9-b60-7590822 amd64 VM: OpenJDK 64-Bit Server VM by Oracle Corporation Windows 10 10.0 GC: G1 Young Generation, G1 Old Generation Memory: 1280M Cores: 8 Registry: external.system.auto.import.disabled=true Non-Bundled Plugins: org.jetbrains.kotlin (211-1.6.20-release-275-AS7442.40)
The deeper issue is likely some version mismatch between the various Jest related modules or between them and Detox and Expo adapters (I hit this after upgrading to SDK 46).
But in the immediate term, you can likely bypass this if needed by twiddling with your config or with the lines of code that are blowing up in node_modules/jest-circus/build/legacy-code-todo-rewrite/jestAdapter.js.
In my jestAdapter, it is line 39 and the commenting out the entire block with the offending property access (below) makes all my tests run fine since I am apparently using real timers under the hood (with expo-jest):
if (config.fakeTimers.enableGlobally) { if (config.fakeTimers.legacyFakeTimers) { // during setup, this cannot be null (and it's fine to explode if it is) environment.fakeTimers.useFakeTimers(); } else { environment.fakeTimersModern.useFakeTimers(); } }