React Native E2E w/ Detox error: "Failed to run application on the device"

Viewed 4438

I have a starter app created with React Native CLI on a Mac, added Detox and am trying to run the sample tests. I get this error (newlines added for easier reading):

$ ./node_modules/.bin/detox -c android test
detox[37289] INFO:  [test.js] configuration="android" reportSpecs=true readOnlyEmu=false 
    useCustomLogger=true forceAdbInstall=false DETOX_START_TIMESTAMP=1591313397594 
    node_modules/.bin/jest --config e2e/config.json '--testNamePattern=^((?!:ios:).)*$' -- 
    maxWorkers 1 android test
detox[37290] INFO:  [DetoxServer.js] server listening on localhost:62332...
detox[37290] ERROR: [DetoxExportWrapper.js/DETOX_INIT_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.

When it runs, the emulator starts but the app does not.

The app runs fine separate from E2E tests, through React Native CLI.

.detoxrc.json

{
  "testRunner": "jest",
  "runnerConfig": "e2e/config.json",
  "configurations": {
    "android": {
      "type": "android.emulator",
      "binaryPath": "android/app/build/outputs/apk/debug/app-debug.apk",
      "build": "cd android; ./gradlew assembleDebug assembleAndroidTest -DtestBiuldType=debug; cd -",
      "device": {
        "avdName": "Pixel_3"
      }
    }
  }
}

Environment:

Detox: 16.7.0
React Native: 0.62.2
Node: v12.17.0
Device: Pixel 3, x86, API 29, Android 10
OS: MacOS 10.15.4
Test-runner: Jest
Android Studio: 3.6.3
1 Answers
Related