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

Can't get app launched via Detox #247

Closed
adamski opened this issue Aug 24, 2017 · 14 comments
Closed

Can't get app launched via Detox #247

adamski opened this issue Aug 24, 2017 · 14 comments

Comments

@adamski
Copy link

adamski commented Aug 24, 2017

I'm trying to get an example project of mine working with Detox, to give you guys an example of the issue at #158.

Although it does reproduce the issue, it does not actually launch, which would make sense in this case. The main app I am working on (which is closed source) does launch via detox but also times out.

The project: https://github.com/adamski/ReactDrum/tree/detox
Its a little more complex than a straight RN project as it's combined with JUCE, as is the closed-source project I'm trying to get working with Detox in debug mode.

Any tips on why the app might not be launching properly? It launches fine via Xcode... this is both in debug and release modes.

Example output:

detox-server info 15:56:38: server listening on localhost:63168...
detox info 1: Listing devices...
detox info Device 134A36A7-072D-4E5C-8D54-40D196E0222A is already booted
detox info 3: Uninstalling com.nodeaudio.ReactDrum...
detox info 3: com.nodeaudio.ReactDrum uninstalled
detox info 4: Installing /Users/adamelemental/dev/juce_projects/ReactDrum/Builds/iOS/Build/Products/Release-iphonesimulator/ReactDrum.app...
detox info 4: /Users/adamelemental/dev/juce_projects/ReactDrum/Builds/iOS/Build/Products/Release-iphonesimulator/ReactDrum.app installed
detox info 5: Terminating com.nodeaudio.ReactDrum...
detox info 5: com.nodeaudio.ReactDrum terminated
detox info 6: Launching com.nodeaudio.ReactDrum...
detox info 6: com.nodeaudio.ReactDrum launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F $HOME/Library/Developer/CoreSimulator/Devices/134A36A7-072D-4E5C-8D54-40D196E0222A/data/tmp/detox.last_launch_app_log.{out,err}
  1) "before all" hook

  0 passing (2m)
  1 failing

  1)  "before all" hook:
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.
@rotemmiz
Copy link
Member

You're app is probably crashing when Detox framework is injected to it.
Please provide device logs
tail -F $HOME/Library/Developer/CoreSimulator/Devices/134A36A7-072D-4E5C-8D54-40D196E0222A/data/tmp/detox.last_launch_app_log.{out,err}

@adamski
Copy link
Author

adamski commented Aug 24, 2017

Log (debug build):

2017-08-24 16:47:40.548 ReactDrum[22344:2332227] Crash handler setup started.
2017-08-24 16:47:40.549 ReactDrum[22344:2332227] Crash handler setup completed.
2017-08-24 16:47:40.549 ReactDrum[22344:2332227] Enabling accessibility for automation on Simulator.
JUCE v4.2.4  // <-- this is the JUCE startup log output. 
2017-08-24 16:47:40.857 ReactDrum[22344:2332227] ☣️ DETOX:: Detox Action Sent: login
2017-08-24 16:47:40.951 ReactDrum[22344:2332227] ☣️ DETOX:: Detox Action Received: loginSuccess

Looks like something is halting / crashing. But no clues as to what from here..

@adamski
Copy link
Author

adamski commented Aug 25, 2017

I'm now getting this issue with my current (closed-source) project, which before I updated was running tests in release mode. Just a black blank screen.

Detox version 5.6.1.

Log output:

objc[17366]: Class PLBuildVersion is implemented in both /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices (0x12488dcc0) and /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/System/Library/PrivateFrameworks/PhotoLibraryServices.framework/PhotoLibraryServices (0x1246a46f0). One of the two will be used. Which one is undefined.
2017-08-25 09:24:22.467 SayIt[17366:2852077] Crash handler setup started.
2017-08-25 09:24:22.468 SayIt[17366:2852077] Crash handler setup completed.
2017-08-25 09:24:22.468 SayIt[17366:2852077] Enabling accessibility for automation on Simulator.
2017-08-25 09:24:22.841 SayIt[17366:2852077] ☣️ DETOX:: Detox Action Sent: login
2017-08-25 09:24:23.038 SayIt[17366:2852077] ☣️ DETOX:: Detox Action Received: loginSuccess

Detox output:

  1) "before all" hook

  0 passing (2m)
  1 failing

  1)  "before all" hook:
     Error: Timeout of 120000ms exceeded. For async tests and hooks, ensure "done()" is called; if returning a Promise, ensure it resolves.

child_process.js:524
    throw err;
    ^

Error: Command failed: node_modules/.bin/mocha e2e --opts e2e/mocha.opts --configuration ios.sim.release
    at checkExecSyncError (child_process.js:481:13)
    at Object.execSync (child_process.js:521:13)
    at Object.<anonymous> (/Users/adamelemental/dev/Phona/sayit/node_modules/detox/local-cli/detox-test.js:46:4)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.runMain (module.js:605:10)
    at run (bootstrap_node.js:427:7)

The strange thing is, if I run the tests in debug mode for this app, the app loads fine but Detox does not seem to attach as in #158

@adamski
Copy link
Author

adamski commented Aug 25, 2017

BTW I just updated my example project so you should be able to build it without messing with the Projucer project. Please let me know if not.

@SMJ93
Copy link
Contributor

SMJ93 commented Sep 6, 2017

@adamski, we had the same issue and fixed it by downgrading detox to 5.3.0.

@Shinichi52
Copy link

i had the same issue

@apolishch
Copy link

I am getting this in CircleCI. Locally my tests run fine. Dropping to detox 5.3.0 is ineffective

@alexkuttig
Copy link

@adamski we had the same problem with our project. We noticed that the combination of our old RN version with the latest detox version was the problem. RN 0.44 was running fine with detox 0.5.3. After updating RN to 0.49.3 it is working fine with the latest detox version. Maybe this helps...

@LeoNatan
Copy link
Contributor

Detox has recently been fixed to work with most RN versions (0.44 and up—we are not aware of unsupported RN since then).

@rumax
Copy link

rumax commented Nov 15, 2017

"react-native": "0.48.4",
"detox": "^5.10.0",
"detox-cli": "^1.0.2",

Issue still exists!

@whoffler
Copy link

whoffler commented Nov 16, 2017

@adamski also seeing this issue with detox v 5.10.0 and react-native v 0.49.3

@LeoNatan
Copy link
Contributor

Could you please open a new issue with the relevant information? Thanks

@LeoNatan
Copy link
Contributor

BTW, internally we still run RN 0.44 and we are able to use the latest Detox. (This is, in fact, why we support such old versions of RN.)

@rumax
Copy link

rumax commented Nov 16, 2017

I do not see any reason to open new issue, I cannot use detox in my project since I've reported #158 were I've mentioned demo project because it was easy to reproduce with it. But unfortunately the issue was closed with the same comment.

Detox seems to be a good project, and easy to use, but it's not always possible. Therefore had to look to other possibilities.

@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

10 participants