MacOS packaged app crash after signing “$APP Helper (GPU).app” with security.app-sandbox
See original GitHub issue- Version: 22.5.1
- Electron Version: 8.2.3
- Electron Type (current, beta, nightly): current
- Target: MacOS
I’ve built an app with ElectronJS and electron-builder. The app has been working well on Win, Linux, so I’m expanding to release for MacOS.
I’m running in issues in signing the app. After signing, the app crashed immediately when launched. (attached crashlog). Electron Quick Start Helper (GPU)_2020-04-25-154511.crash.zip I’m using MacOS 10.15.4
So I’ve clone electron-quick-start and apply the same signing steps, and get the same issue.
After many trial and errors.
I’ve narrowed down the issue to that if we sign:
codesign -s "$APP_KEY" -f --entitlements "$CHILD_PLIST" "$FRAMEWORKS_PATH/$APP Helper (GPU).app/"
where the PLIST has
<key>com.apple.security.app-sandbox</key><true/>
The app will crash.
Steps to replicate: You can try to clone my fork of electron-quick-start here: https://github.com/le1771/electron-quick-start
First run:
export CSC_IDENTITY_AUTO_DISCOVERY=false. #to disable auto sign
yarn
yarn package-mac
Run the packaged “Electron Quick Start.app” in /release/mas => it launched fine
Next run the signing script, you will need to set value for $APP_KEY, $INSTALLER_KEY
./build/resignAndPackage.sh
Now run the “Electron Quick Start.app” in /release/mas again, it crashes.
If I remove the
<key>com.apple.security.app-sandbox</key><true/>
in entitlements.mas.inherit.plist then the app will not crash.
But of course, we can’t notarize the app or submit to Apple Store because it lack of sandbox.
If I add app-sandbox back, the signing works well, and pass Apple’s Notary check, and I was able to upload to Apple App Store, but of course, it failed review because the app crashed on start up.
I’ve tried with various combination of nodejs, electron and electron builder, all have the same issue. What I tried:
- node: 12.16.2 - electron 8.2.3 - electron-builder 22.5.1
- node: 10.20.1 - electron 8.2.3 - electron-builder 22.5.1
- node: 10.20.1 - electron 8.2.3 - electron-builder 21.2.0
- node 10.20.1 - electron 6.1.10 - electron-builder 22.5.1
- node 10.20.1 - electron 6.1.7 - electron-builder 22.5.1
- node 8.17.0 - electron 4.2.12 - electron-builder 22.5.1
- node 8.17.0 - electron 4.2.12 - electron-builder 21.2.0
- node 8.17.0 - electron 4.2.12 - electron-builder 20.44.4 The older electron 4.2.12 did not come with $APP Helper (GPU).app, it only come with $APP Helper.app, but after signing the $APP Helper.app, the app crashed the same way.
I’ve referred to: https://www.electronjs.org/docs/tutorial/mac-app-store-submission-guide https://medium.com/@jondot/shipping-electron-apps-to-mac-app-store-with-electron-builder-e960d46148ec https://kilianvalkhof.com/2019/electron/notarizing-your-electron-application/
Has anyone run into this issue before? Any help would be much appreciated!
Issue Analytics
- State:
- Created 3 years ago
- Comments:9
Top GitHub Comments
Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
I’m running into this exact same problem, has there been any fixes for it, or has anyone figured out a workaround?