I'm trying to set up travis CI for my application with Detox as the test suite. I'm close to achieving the final setup, but I'm currently stuck on the following error which occurs during the final step of the build (testing phase, since the android.emu.release configuration builds successfully, though slowly).
detox[6708] ERROR: [Emulator.js/SPAWN_FAIL] unknown option: -read-only
npx detox test --headless -c android.emu.release --gpu swiftshader --cleanup
detox[6696] INFO: [test.js] configuration="android.emu.release" cleanup=true gpu="swiftshader" headless=true reportSpecs=true readOnlyEmu=false DETOX_START_TIMESTAMP=1578027757256 node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' --maxWorkers 1 "e2e"
detox[6708] INFO: [DetoxServer.js] server listening on localhost:38035...
detox[6708] ERROR: [Emulator.js/SPAWN_FAIL] `/usr/local/android-sdk/tools/emulator -verbose -no-audio -no-boot-anim -no-window -read-only -port 17944 @pixel9 -gpu swiftshader` failed with code 1
err: ChildProcessError: `/usr/local/android-sdk/tools/emulator -verbose -no-audio -no-boot-anim -no-window -read-only -port 17944 @pixel9 -gpu swiftshader` failed with code 1
at ChildProcess.<anonymous> (/home/travis/build/uva-cp-1920/PowerShare/src/PowerShare/node_modules/child-process-promise/lib/index.js:132:23)
at ChildProcess.emit (events.js:305:20)
at maybeClose (internal/child_process.js:1028:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
detox[6708] ERROR: [Emulator.js/SPAWN_FAIL] unknown option: -read-only
please use -help for a list of valid options
detox[6708] ERROR: [DetoxExportWrapper.js/DETOX_INIT_ERROR]
For reference, below is my .travis.yml file:
#before_install:
env:
global:
- NODE_VERSION=stable
matrix:
include:
- language: android
cache: yarn
jdk: oraclejdk8
dist: trusty
sudo: required
android:
components:
- build-tools-28.0.3
- android-28
- sys-img-x86-android-28
install:
- echo no | android create avd --force -n pixel9 -t android-28 --abi default/x86
- curl -sL https://deb.nodesource.com/setup_13.x | sudo -E bash -
- sudo apt-get install -y nodejs
script:
- cd src/PowerShare/
- yarn
- echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
- npx detox build -c android.emu.release
- npx detox test --headless -c android.emu.release --gpu swiftshader --cleanup
I'm using the latest node version (13.5.0), react native is 0.61.2, and Detox is 14.9.2. Also, if anyone has any suggestions on how to speed up my build (currently takes around ~8 minutes for a full build), that would be appreciated as well!
EDIT: This has been resolved as of v15.1.4.