Detox: Can't launch android simulator due to ERROR: [Emulator.js/SPAWN_FAIL]

Created on 29 Dec 2018  路  3Comments  路  Source: wix/Detox

running detox test -c android.emu.debug but not able to launch emulator
saw similar issue https://github.com/wix/detox/issues/714
but it should be fixed in detox 9.1.2

"android.emu.debug": {
"binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
"build": "cd android && ./gradlew assembleDebug assembleAndroidTest -DtestBuildType=debug && cd ..",
"type": "android.emulator",
"name": "TestEmulator2"
}

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 9.1.2
  • React Native: 0.55.0
  • Node: 11.6.0

Device and verbose Detox logs

`detox test -c android.emu.debug --loglevel verbose
node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration android.emu.debug --loglevel verbose --grep :ios: --invert --artifacts-location "artifacts/android.emu.debug.2018-12-29 05-42-23Z"

detox[12635] INFO: [DetoxServer.js] server listening on localhost:51549...
detox[12635] DEBUG: [AsyncWebSocket.js/WEBSOCKET_OPEN] opened web socket to: ws://localhost:51549
detox[12635] DEBUG: [DetoxServer.js/LOGIN] role=tester, sessionId=85bfc613-854a-06f9-ce7e-b9a79789f773
detox[12635] DEBUG: [DetoxServer.js/LOGIN_SUCCESS] role=tester, sessionId=85bfc613-854a-06f9-ce7e-b9a79789f773
detox[12635] DEBUG: [exec.js/EXEC_CMD, #0] /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -list-avds --verbose
detox[12635] DEBUG: [exec.js/EXEC_CMD, #1] /Users/pranaybiswas/Library/Android/sdk/platform-tools/adb devices
detox[12635] DEBUG: [Emulator.js/SPAWN_CMD] /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -verbose -gpu host -no-audio @TestEmulator2
detox[12635] ERROR: [Emulator.js/SPAWN_FAIL] /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -verbose -gpu host -no-audio @TestEmulator2 failed with code 1
err: ChildProcessError: /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -verbose -gpu host -no-audio @TestEmulator2 failed with code 1
at ChildProcess. (/Users/pranaybiswas/native_app/unacademy-native/node_modules/child-process-promise/lib/index.js:132:23)
at ChildProcess.emit (events.js:188:13)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
detox[12635] ERROR: [Emulator.js/SPAWN_FAIL] emulator: Android virtual device file at: /Users/pranaybiswas/.android/avd/TestEmulator2.ini
emulator: virtual device content at /Users/pranaybiswas/.android/avd/TestEmulator2.avd
emulator: virtual device config file: /Users/pranaybiswas/.android/avd/TestEmulator2.avd/config.ini
emulator: using core hw config path: /Users/pranaybiswas/.android/avd/TestEmulator2.avd/hardware-qemu.ini
emulator: using snapshot lock path: /Users/pranaybiswas/.android/avd/TestEmulator2.avd/snapshot.lock
emulator: Found AVD target API level: 23
emulator: Read property file at /Users/pranaybiswas/android-sdks/system-images/android-23/android-tv/x86//build.prop
emulator: No boot.prop property file found.
emulator: 'magic' skin format detected: 768x1280
emulator: autoconfig: -skin 768x1280
emulator: autoconfig: -skindir (null)
emulator: autoconfig: -kernel /Users/pranaybiswas/android-sdks/system-images/android-23/android-tv/x86//kernel-ranchu
emulator: Target arch = 'x86'
emulator: Auto-config: -qemu -cpu qemu32
emulator: Auto-detect: Kernel image requires new device naming scheme.
emulator: Auto-detect: Kernel does not support YAFFS2 partitions.
emulator: autoconfig: -ramdisk /Users/pranaybiswas/android-sdks/system-images/android-23/android-tv/x86//ramdisk.img
emulator: ERROR: No initial system image for this configuration!

detox[12635] ERROR: [index.js/DETOX_INIT_ERROR]
{ ChildProcessError: /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -verbose -gpu host -no-audio @TestEmulator2 failed with code 1
at ChildProcess. (/Users/pranaybiswas/native_app/unacademy-native/node_modules/child-process-promise/lib/index.js:132:23)
at ChildProcess.emit (events.js:188:13)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)
name: 'ChildProcessError',
code: 1,
childProcess:
ChildProcess {
_events:
[Object: null prototype] { error: [Function], close: [Function] },
_eventsCount: 2,
_maxListeners: undefined,
_closesNeeded: 1,
_closesGot: 1,
connected: false,
signalCode: null,
exitCode: 1,
killed: false,
spawnfile: '/Users/pranaybiswas/Library/Android/sdk/emulator/emulator',
_handle: null,
spawnargs:
[ '/Users/pranaybiswas/Library/Android/sdk/emulator/emulator',
'-verbose',
'-gpu',
'host',
'-no-audio',
'@TestEmulator2' ],
pid: 12638,
stdin: null,
stdout: null,
stderr: null,
stdio: [ null, null, null ] },
stdout: undefined,
stderr: undefined }
1) "before all" hook

0 passing (490ms)
1 failing

1) "before all" hook:
ChildProcessError: /Users/pranaybiswas/Library/Android/sdk/emulator/emulator -verbose -gpu host -no-audio @TestEmulator2 failed with code 1
at ChildProcess. (node_modules/child-process-promise/lib/index.js:132:23)
at maybeClose (internal/child_process.js:978:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:265:5)

`

questiostack overflow

Most helpful comment

Seems like you don't have emulator image for the configuration you selected, download it from SDK manager.

emulator: ERROR: No initial system image for this configuration!

All 3 comments

Seems like you don't have emulator image for the configuration you selected, download it from SDK manager.

emulator: ERROR: No initial system image for this configuration!

@rotemmiz Thank you for pointing out exact error 馃憤

We use the issue tracker exclusively for bug reports and feature requests. This issue appears to be a general usage or support question. Instead, please ask a question on Stack Overflow with the detox tag.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

brunobar79 picture brunobar79  路  4Comments

carlosalmonte04 picture carlosalmonte04  路  4Comments

rikur picture rikur  路  4Comments

raphkr picture raphkr  路  4Comments

LeoNatan picture LeoNatan  路  4Comments