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 launches but immediately closes #152

Closed
talarari opened this issue Jun 6, 2017 · 31 comments
Closed

App launches but immediately closes #152

talarari opened this issue Jun 6, 2017 · 31 comments

Comments

@talarari
Copy link

talarari commented Jun 6, 2017

i ran the example project and everything works fine.
but when i run my project it launches the app and immediately closes it (goes back to home screen).

when i manually open the app on the simulator (after detox installed it), it launches fine.

we're running a react-native 0.42.3

any suggestions?

@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 6, 2017

It sounds like the app is crashing.
Please provide the crash reason. You can use the Console app on macOS to see what the crash reason is.

@devinceble
Copy link

devinceble commented Jun 7, 2017

Same Here Produce Error Message:
Currently Investigating the Issue It May Be Cause by some react-native package not detox

screen shot 2017-06-07 at 11 26 17 am

@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 7, 2017

I don’t see a crash information in that log print.

@devinceble
Copy link

The crash is "Service exited due to Abort trap: 6" mostly from links of react-native packages but XCODE would run the app without problems I think this is not detox problem.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jun 9, 2017

That's too generic. I cannot help if I don't know why this is happening.

Another way to discover the crash details is to change the scheme of your project to wait until you app is launch (like detailed here), press Play in Xcode, then run detox. This will make Xcode attach to the process spawned by Detox. If there is a crash, Xcode will breakpoint and show you. If you see it has stopped on objc_exception_throw, type po $arg1 in the debugger pane of Xcode.

@tglanz
Copy link

tglanz commented Jul 4, 2017

Tried to investigate this further by simulating what detox does manually and ran fbsimctl manually in all sorts of variations.

Apparently the situation happens only when setting the FBSIMCTL_CHILD_DYLD_INSERT_LIBRARIES environment variable to point to Detox.framework/detox path (as indicated in the getting started guid). If i remove the variable the application won't crash on startup (Of course that detox won't be able to run).
Ran detox server (by detox run-server) and launched the app in the simulator, fbsimctl stderr output indicated an error:
dyld: Symbol not found: __swiftEmptyDictionaryStorage Referenced from: [react native path]/node_modules/detox/Detox.framework/Detox Expected in: /Users/[me]/Library/Developer/CoreSimulator/Devices/671BEED2-A643-49F1-802B-B165F56A772F/data/Containers/Bundle/Application/C948219E-8AF4-4765-9742-AAC874D099E8/[the app file name].app/Frameworks/libswiftCore.dylib in /Users/[me]/[react native path]/node_modules/detox/Detox.framework/Detox

@tglanz
Copy link

tglanz commented Jul 5, 2017

Have managed to replicate the issue on the "demo-react-native" example app (from the repo) by replacing the objective-c files to swift code.

Am using swift 3.1

@LeoNatan
Copy link
Contributor

LeoNatan commented Jul 5, 2017

Hmm. What Xcode version are you using? I think there may be a Swift library collision there.

@tglanz
Copy link

tglanz commented Jul 5, 2017

xcode 8.2.1

@sriram289
Copy link

I tried to build the firefox-ios app with detox and the app crashes. I am also experiencing the same issue.

@LeoNatan
Copy link
Contributor

LeoNatan commented Jul 7, 2017

Hang in there, guys, I will look for a solution early next week. I have taken this as top priority for me now.

@LeoNatan LeoNatan self-assigned this Jul 7, 2017
@tglanz
Copy link

tglanz commented Jul 9, 2017

thanks, let us now if we could help with debugs

@sameerpattanaik
Copy link

Hi @LeoNatan , any update on the app crashing issue, as i was going through the example app for the demo react native project and the app is still crashing in iphone simulator.

@LeoNatan
Copy link
Contributor

Which demo app did you run? This issue is specifically for Swift issues.

Regarding Swift, we have considered a solution, but I need help from guys that can help in JavaScript. CC @rotemmiz @silyevsk

@sameerpattanaik
Copy link

sameerpattanaik commented Jul 19, 2017 via email

@LeoNatan
Copy link
Contributor

@silyevsk Sergey, please assist here, how to enable logs to see what is happening?

@silyevsk
Copy link
Contributor

When you run detox, there's a line that prints the logs location (every time it launches the app), it looks like this:

detox info 6: org.reactjs.native.example.example launched. The stdout and stderr logs were recreated, you can watch them with:
        tail -F $HOME/Library/Developer/CoreSimulator/Devices/EB9B3A90-621B-4F6E-815C-1E5C17ED5ABE/data/tmp/detox.last_launch_app_log.{out,err}

So in the above example the error log is $HOME/Library/Developer/CoreSimulator/Devices/EB9B3A90-621B-4F6E-815C-1E5C17ED5ABE/data/tmp/detox.last_launch_app_log.err

@jlongster
Copy link

This is the error that we are running into fwiw (we are using swift): https://gist.github.com/jlongster/0edb53ce69cbd038d65e207f9586a1d0

@sameerpattanaik
Copy link

sameerpattanaik commented Jul 20, 2017 via email

@rotemmiz
Copy link
Member

Looks like an issue with your bundle, which was not created for some reason
2017-07-20 13:11:32.233 [fatal][tid:main] No script URL provided. Make sure the packager is running or you have embedded a JS bundle in your

Does the app work when you open it manually ?

@jlongster
Copy link

Does my error in #152 (comment) make any sense in light of this bug? I'm curious if I should wait until this is fixed to try again or I should investigate further. (no rush)

@LeoNatan
Copy link
Contributor

Hmm this is a new issue. @jlongster
Please open a new issue for that and attach the log. Thanks

@sameerpattanaik
Copy link

sameerpattanaik commented Jul 24, 2017 via email

@tglanz
Copy link

tglanz commented Aug 3, 2017

Hi, is there any update regarding this issue?

@LeoNatan
Copy link
Contributor

LeoNatan commented Aug 3, 2017

Awaiting help from JS knowledgeable guys. 😞

@isnifer
Copy link
Contributor

isnifer commented Aug 3, 2017

@tglanz @LeoNatan
I have successfully integrated detox into our build process instead of appium (of course currently for iOS only). We're building our application with fastlane.
Detox works sooooooo much better than appium (also so much faster).
I'm sure that the main problem is the wrong build.

@tglanz did you test Release-iphonesimulator build?

@madhu314
Copy link

madhu314 commented Sep 5, 2017

Facing same issues as mentioned by @tglanz
happens when AppDelegate is swift file, App crashes at line self.window = UIWindow(frame: UIScreen.main.bounds)

Also I can confirm that this does not happen with version "5.5.1"

@LeoNatan Is it possible that the fix made in f46989b caused this regression ?

For now, I will continue using 5.5.1

Thanks!

@LeoNatan
Copy link
Contributor

LeoNatan commented Sep 6, 2017

@madhu314 What is the exact reason for the crash? I cannot think of a reason for the window to cause a crash.

@madhu314
Copy link

madhu314 commented Sep 6, 2017

Hey @LeoNatan
So I am running into EXC_BAD_ACCESS as soon as self.window is referred and app crashes with Segmentation Fault. So basically there is a bad memory reference

As I mentioned in the previous comment happens only with 5.60 and above, I don't see this problem with 5.5.1

@LeoNatan
Copy link
Contributor

LeoNatan commented Sep 6, 2017

@madhu314 Please post a separate issue for this.

@LeoNatan
Copy link
Contributor

This issue has been solved for a while.

@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