-
Notifications
You must be signed in to change notification settings - Fork 98
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
MAS build crashes right before mainWindow gets visible: GPU not usable #313
Comments
Problem solved. After trying so many different things and given the time it takes to test anything (upload, wait for validation...) I cannot be 100% sure but I believe it is about making sure I do not use the same entitlements for main app and other files (I need additional entitlements so cannot use default ones):
|
@nbonamy Could you please elaborate on the entitlements you need for the main app and those you need for other files? Preferably with an example :) I have been trying to deal with exactly the issue you are describing for 6 months now and I believe your finding will solve it. |
@Rychu-Pawel you can check my repo here: https://github.com/nbonamy/witsy Specifically:
Hope that helps! |
@nbonamy you are great! This worked for me! Man... this should be better documented in the guide. I'm so happy it finally worked 🎉 |
I am posting electron/electron#41927 here feeling it may very be osx-sign specific.
Preflight Checklist
Electron Version
29.1.6
What operating system are you using?
macOS
Operating System Version
14.4.1 (23E224)
What arch are you using?
arm64 (including Apple Silicon)
Last Known Working Electron version
No response
Expected Behavior
MAS builds require
com.apple.security.app-sandbox
entitlement to betrue
. I have removed basically all code from my electron app (empty preload, renderer just doingdocument.querySelector('...').innerHTML = '....'
. Also made sure that the only difference between a crashing MAS build and a working Darwin build is the sandbox entitlement.I open the mainWindow with the following options:
Tested both with
sandbox:true
andsandbox:false
(default).Added some logs to make sure no other code was interfering.
Also tested a build with an early
app.disableHardwareAcceleration();
but that did not change anything.Actual Behavior
Apple to sign and upload build to App Store Connect. Then after install from TestFlight, application crashes with following log:
Not sure what to do from here.
Testcase Gist URL
No response
Additional Information
Using electron-forge with vite-plugin to build.
Also adding the
com.apple.security.app-sandbox
entitlement to a working Darwin build makes it crash immediately on launch with just:By adding
app.commandLine.appendSwitch('in-process-gpu')
I can get rid of the GPU crash (not sure about side effects though) but then I get in an infinite loop of:Also Created a blank project using instructions from https://www.electronforge.io/templates/vite:
npm init electron-app@latest my-new-app -- --template=vite
Did no modifications except:
After upload and validation by Apple and install through TestFlight, the binary crashes immediately with
Trace/BPT trap: 5
Dumped the defaults entitlements and added
com.apple.security.cs.allow-jit
. After same process seeing same issue:Entitlements:
The text was updated successfully, but these errors were encountered: