Built MacOS App Crashes on Load

Report Construct 2 bugs here.

Post » Tue Jul 04, 2017 1:56 am

Problem Description
When building with Node-Webkit v0.22 or v0.23, the resulting MacOS app crashes immediately after running. Building with Node-Webkit 0.15->0.21 seem to be ok. (haven't checked linux & windows in every case, im assuming windows is QA'd before release).

Attach a Capx
https://www.dropbox.com/s/tn5yf6a62gtr0 ... .capx?dl=0

Description of Capx
Basic CapX with only a single text object, or just build a fresh empty project to see the bug.

Steps to Reproduce Bug
  • Open Capx
  • Export with NodeWebkit 0.23 or 0.22
  • Zip the osx64 folder and bring to macOS
  • Extract zip and run .app file.

Observed Result
Crash. Will comment with crash log if it is helpful.

Expected Result
App runs.

Affected Browsers
n/a

Operating System and Service Pack
Mac OS Sierra 10.12.5 (16F73)

Construct 2 Version ID
Release 244.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Jul 04, 2017 2:08 am

just to be thorough, in case it helps, here's the pastebin of the full crash report:

https://pastebin.com/zfkBEpbL
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Tue Jul 04, 2017 4:44 pm

https://github.com/nwjs-community/nw-builder/issues/445

Found this thread which at least has a similar error code:

Logical CPU: 0
Error Code: 0x02000148
Trap Number: 133

He mentions this commit as a fix. I don't know if its also related to how C2 does stuff, but im really just trying to help.

https://github.com/nwjs-community/nw-bu ... 3df46406af
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Wed Jul 05, 2017 12:45 pm

Are you sure you're not accidentally trashing the OS X file permissions on Windows? Your described steps of zipping the app on Windows will cause this, and break the app once transferred to OS X. This is documented here: https://www.scirra.com/tutorials/1276/exporting-desktop-apps-with-node-webkit

You need to copy the files via the Mac to preserve file permissions.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Thu Jul 06, 2017 3:48 am

@Ashley

Thanks for looking at this.

Unfortunately has nothing to do with permissions, bug persists with correct permissions. Read the rest of the post for more thorough response.

Please note (for documentation / future support) that copying a file from a mapped windows drive within MacOS does *not* set correct permissions for the MacOS app. The correct way is to run "sudo chmod -R 0755 yourappname.app" or a helpful trick if working in a virtual machine is to zip the app and bring the zip over.. Dont ask me how zipping it works but it works.

--

Zipping the file and bringing it into OSX is the only way to correctly get it to run without having to mess with the permissions. Here are 3 tests:

drwxrwxrwx 3 nateschmold staff 102 3 Jul 19:05 test1.app
drwxr-xr-x 3 nateschmold staff 102 3 Jul 19:05 test2.app
drwxrwxrwx 3 nateschmold staff 102 3 Jul 19:05 test3.app

test1.app = bringing the over directly from Parallels into MacOS
test2.app = zipping in windows, transferring zip to macOS and unzipping in MacOS
test3.app = dragging the app from a mapped Windows drive into a folder within MacOS/finder.

test1.app and test3.app both result in "The application “testX” can’t be opened."
test2.app runs, but crashes with above error/bug.

I can confirm that zipping the file and bringing it over does indeed work with a file built with nwjs 0.20 -- app runs totally fine in that case.

To further confirm, if i set proper permissions on test1.app or test3.app using the terminal command:
sudo chmod -R 0755 test1.app

The app will finally stop giving the "The application __ can't be opened" window, and will instead run the app, but then crash with the error in the original post. So it doesn't have anything to do with permissions unfortunately, please try above steps to replicate the bug.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Thu Jul 06, 2017 10:00 am

FYI OS X apps are a whole folder with lots of files inside that all need the correct permissions, so simply changing the permission on the .app folder won't fix broken permissions if they were lost in the transfer. There's a number of internal symlinks that need to be preserved, for example. Anyways I'll try to look in to this some more today.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Thu Jul 06, 2017 11:37 am

disable webgl
B
46
S
16
G
8
Posts: 794
Reputation: 8,335

Post » Thu Jul 06, 2017 2:47 pm

Ashley wrote:FYI OS X apps are a whole folder with lots of files inside that all need the correct permissions, so simply changing the permission on the .app folder won't fix broken permissions if they were lost in the transfer. There's a number of internal symlinks that need to be preserved, for example. Anyways I'll try to look in to this some more today.


(re: sudo chmod -R 0755 test1.app)

-R is the flag to recursively set permissions on parent .app folder and all files & folders within it.

Thanks for looking into this.
Made Cosmochoria - www.cosmochoria.com
Currently working on Slayaway Camp - www.slayawaycamp.com
B
27
S
8
G
3
Posts: 384
Reputation: 5,020

Post » Thu Jul 06, 2017 2:57 pm

Symlinks need permissions that other files shouldn't have, so you can't recursively apply the same permissions to an entire OS X NW.js app and get something that works, you will either break the symlinks or make normal files in to symlinks which breaks them.
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Post » Thu Jul 06, 2017 3:25 pm

I just tested C3's export and that works on OS X even with NW.js 0.23. It uses the same set as files as the C2 NW.js export so I'm pretty sure this is still a file permission related issue and not that NW.js itself is broken. I'm not sure what would have changed, but it's pretty difficult to get files from Windows to Mac while preserving permissions since Windows doesn't understand or care about some important file permissions that are needed on OS X. C3 works around it with some byzantine tweaking of the zip format. Not sure what the best solution for C2 is. Maybe we just need to publish a script to run through the whole app folder and set the right permissions where they need to be...
Scirra Founder
B
397
S
236
G
88
Posts: 24,389
Reputation: 194,448

Next

Return to Bugs

Who is online

Users browsing this forum: Stweve and 0 guests