0 Favourites

Built MacOS App Crashes on Load

  • 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

    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.

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

  • 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.

  • Construct 3

    Buy Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Buy Now Construct 3 users don't see these ads
  • 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.

  • 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.

  • 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.

  • disable webgl

  • 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.

  • 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.

  • 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...

  • Right, I think the problem is NW.js 0.22 is actually the first version that started using symlinks, and Windows has no concept of these symlinks at all, so they are completely lost via any way you try to copy the files. That's new and very awkward, since I'm not sure there's anything C2 itself can do to work around it...

    Still, I found a workaround: on the Mac itself, download NW.js directly from https://nwjs.io/downloads/. (You should be able to do this with any version for the OS X export.) Extract the NW.js download on the Mac. It should run because it has preserved the file permissions, since you did everything on the Mac. Then export with C2 and copy the files over to the Mac any way, it doesn't matter how any more. You can open the app folder by right-clicking and selecting "Show Package Contents". Using that, you can open the C2 exported app, and copy the Contents/Resources folder. Then open the NW.js download and delete the Contents/Resources folder, and paste in the one from C2.

    That basically copies the C2 game data in to an ordinary NW.js download. It seems to make a working macOS app for me which runs the game OK. It's a bit of a bigger file since C2 strips out some stuff it doesn't need, like the pnacl stuff. You can delete it yourself by going to a path in the package like Contents/Versions/<version>/nwjs Framework.framework/Internet Plug-Ins and delete the contents of that folder (a .nexe file and pnacl). That should strip ~20mb or so.

  • Ashley

    Thanks so much for the deep dive.

    Good news is if i download nwjs 23 on the mac, replace the Resources folder from the C2 Export, everything is gold, the app runs fine in OSX.

    Bad news is, my steamworks SDK is in windows, so the minute i move the mac app back to windows for building / uploading to steamworks, it breaks the app.

    Can you think of any way to get the app file back into windows safely while preserving the symlinks?

    If not, I suppose I can look into setting up the steamworks sdk to build on the mac and just deal with windows permissions stuff from bringing the windows files over to mac then uploading on the mac.. have never tried that so its mostly just unexplored territory causing apprehension haha

  • Honestly I think the best thing to do is just do everything on the Mac if at all possible. Transferring files to Windows and back without losing special file permissions on the symlinks is difficult - I'm not sure if it's even possible, the two OSs treat symlinks differently.

  • No prob, will setup the build environment and let you know how it goes. I cant see why it wont be golden tho, the initial problem is solved by copying the files into that fresh nwjs download Thanks for the help & for your time, I know you're a busy dude.

    Respect.

  • A dumb question Ashley when you said "Then export with C2 and copy the files over to the Mac" means to run an Construct 2 export to NWJS or a regular Export to HTML5?

    I'm trying to create my game to run on MAC OSX the game works fine but i'm taking a lot of issues on codesign my app since NWJS documentation is a bit different structured folders, i'm not sure on how to codesign my app successfully, any help will be appreciated .

    Regards

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)