Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

App binary not found - Android #813

Closed
sant123 opened this issue Jul 5, 2018 · 2 comments
Closed

App binary not found - Android #813

sant123 opened this issue Jul 5, 2018 · 2 comments

Comments

@sant123
Copy link

sant123 commented Jul 5, 2018

Description

I'm trying to run the android test but in simply breaks with this error:

image
I have tried:

In IOS works like a charm, but with Android I'm having this issue.

Steps to Reproduce

  • Create a new react-native project react-native init AwesomeProject
  • Add these scripts in package.json
"scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "android": "node node_modules/react-native/local-cli/cli.js run-android",
    "ios": "node node_modules/react-native/local-cli/cli.js run-ios",
    "build:android": "detox build -c android.emu.debug",
    "test:android": "detox test -c android.emu.debug",
    "test": "jest",
    "eject": "node node_modules/react-native/local-cli/cli.js eject"
  },

Detox, Node, Device, Xcode and macOS Versions

  • Detox: 8.0.0
  • React Native: 0.56.0
  • Node: 8.11.3
  • Device: Nexus 5X API 24 (emulator)
  • Xcode: 9.4.1
  • macOS: High Sierra 10.13.5

Device and verbose Detox logs

Paola-Mac:AwesomeProject paolamoreno$ yarn test:android --loglevel verbose
yarn run v1.7.0
$ detox test -c android.emu.debug --loglevel verbose
node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:ios:).)*$'
 server listening on localhost:56385...
 onOpen [object Object]
 send: {"type":"login","params":{"sessionId":"0d1cceb1-67d6-e18c-c2da-33138b6bd350","role":"tester"},"messageId":0}
 onMessage: {"type":"loginSuccess","params":{"sessionId":"0d1cceb1-67d6-e18c-c2da-33138b6bd350","role":"tester"},"messageId":0}
  rbx
 finalized artifacts successfully
 FAIL  e2e/example.spec.js
  Example
    ✕ should have welcome screen (10ms)
    ○ skipped 2 tests

  ● Example › should have welcome screen

    app binary not found at '/Users/paolamoreno/Desktop/AwesomeProject/android/app/build/outputs/apk/debug/app-debug.apk', did you build it?

      at Device._getAbsolutePath (../node_modules/detox/src/devices/Device.js:281:13)
      at Device.prepare (../node_modules/detox/src/devices/Device.js:45:29)
      at Detox.init (../node_modules/detox/src/Detox.js:59:23)

  ● Example › should have welcome screen

    ReferenceError: device is not defined

      1 | describe('Example', () => {
      2 |     beforeEach(async () => {
    > 3 |       await device.reloadReactNative();
        |             ^
      4 |     });
      5 |
      6 |     test.only('should have welcome screen', async () => {

      at Object._callee$ (example.spec.js:3:13)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
      at ../node_modules/regenerator-runtime/runtime.js:195:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
      at Object._callee (example.spec.js:2:16)

  ● Example › should have welcome screen

    ReferenceError: element is not defined

      4 |     });
      5 |
    > 6 |     test.only('should have welcome screen', async () => {
        |                                             ^
      7 |       await expect(element(by.id('welcome'))).toBeVisible();
      8 |     });
      9 |

      at Object._callee2$ (example.spec.js:6:45)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at Generator.invoke [as _invoke] (../node_modules/regenerator-runtime/runtime.js:296:22)
      at Generator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at tryCatch (../node_modules/regenerator-runtime/runtime.js:62:40)
      at invoke (../node_modules/regenerator-runtime/runtime.js:152:20)
      at ../node_modules/regenerator-runtime/runtime.js:195:11
      at callInvokeWithMethodAndArg (../node_modules/regenerator-runtime/runtime.js:194:16)
      at AsyncIterator.enqueue (../node_modules/regenerator-runtime/runtime.js:217:13)
      at AsyncIterator.prototype.(anonymous function) [as next] (../node_modules/regenerator-runtime/runtime.js:114:21)
      at Object.<anonymous>.runtime.async (../node_modules/regenerator-runtime/runtime.js:241:14)
      at Object._callee2 (example.spec.js:6:45)

  ● Example › should show hello screen after tap

    app binary not found at '/Users/paolamoreno/Desktop/AwesomeProject/android/app/build/outputs/apk/debug/app-debug.apk', did you build it?

      at Device._getAbsolutePath (../node_modules/detox/src/devices/Device.js:281:13)
      at Device.prepare (../node_modules/detox/src/devices/Device.js:45:29)
      at Detox.init (../node_modules/detox/src/Detox.js:59:23)

  ● Example › should show world screen after tap

    app binary not found at '/Users/paolamoreno/Desktop/AwesomeProject/android/app/build/outputs/apk/debug/app-debug.apk', did you build it?

      at Device._getAbsolutePath (../node_modules/detox/src/devices/Device.js:281:13)
      at Device.prepare (../node_modules/detox/src/devices/Device.js:45:29)
      at Detox.init (../node_modules/detox/src/Detox.js:59:23)

Test Suites: 1 failed, 1 total
Tests:       1 failed, 2 skipped, 3 total
Snapshots:   0 total
Time:        2.476s
Ran all test suites matching /e2e/i with tests matching "^((?!:ios:).)*$".
child_process.js:644
    throw err;
    ^

Error: Command failed: node_modules/.bin/jest e2e --config=e2e/config.json --maxWorkers=1 --testNamePattern='^((?!:ios:).)*$'
    at checkExecSyncError (child_process.js:601:13)
    at Object.execSync (child_process.js:641:13)
    at runJest (/Users/paolamoreno/Desktop/AwesomeProject/node_modules/detox/local-cli/detox-test.js:146:6)
    at run (/Users/paolamoreno/Desktop/AwesomeProject/node_modules/detox/local-cli/detox-test.js:81:7)
    at Object.<anonymous> (/Users/paolamoreno/Desktop/AwesomeProject/node_modules/detox/local-cli/detox-test.js:191:1)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Package.json

{
  "name": "AwesomeProject",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node node_modules/react-native/local-cli/cli.js start",
    "android": "node node_modules/react-native/local-cli/cli.js run-android",
    "ios": "node node_modules/react-native/local-cli/cli.js run-ios",
    "build:android": "detox build -c android.emu.debug",
    "test:android": "detox test -c android.emu.debug",
    "test": "jest",
    "eject": "node node_modules/react-native/local-cli/cli.js eject"
  },
  "dependencies": {
    "react": "16.4.1",
    "react-native": "0.56.0"
  },
  "devDependencies": {
    "babel-jest": "23.2.0",
    "babel-preset-react-native": "^4.0.0",
    "detox": "^8.0.0",
    "jest": "23.3.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  },
  "detox": {
    "test-runner": "jest",
    "specs": "e2e",
    "configurations": {
      "ios.sim.debug": {
        "binaryPath": "ios/build/Build/Products/Debug-iphonesimulator/AwesomeProject.app",
        "build": "xcodebuild -project ios/AwesomeProject.xcodeproj -scheme AwesomeProject -configuration Debug -sdk iphonesimulator -derivedDataPath ios/build",
        "type": "ios.simulator",
        "name": "iPhone 6"
      }, 
      "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": "Nexus_5X_API_24"
    },
    "android.emu.release": {
        "binaryPath": "android/app/build/outputs/apk/release/app-release.apk",
        "build":
        "cd android && ./gradlew assembleRelease assembleAndroidTest -DtestBuildType=release && cd ..",
        "type": "android.emulator",
        "name": "Nexus_5X_API_24"
    }
    }
  }
}

Thanks!

@rotemmiz
Copy link
Member

rotemmiz commented Jul 5, 2018

Seems like you're having issues with you build process.
Check that the build output is actually at the folder you point detox to.

@support
Copy link

support bot commented Jul 5, 2018

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.

@support support bot closed this as completed Jul 5, 2018
@wix wix locked and limited conversation to collaborators Jul 23, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants