Closed AxelTerizaki closed 2 years ago
I experience the same issue with electron 20, running it with the electron executable is ok. I am using apple silicone as well, macOS 12.4.
I wasn't able to narrow down the cause yet. I'll update if I do.
@idanwork thanks for your comment, it actually made me try something since you mentionned Electron 20.
I downgraded Electron to version 19.0.11 and the app seems to work!
So I guess this is more of an Electron bug, but we don't know what electron-builder does that would make it crash?
Hi I tried packaging empty application with electron-builder and electron 20 I didn't get the error, Later I've added all the 3rd party modules and packaged again with no issue (double click will open the app). So now I've trying to code-eliminate my code.
On Electron 19.x it works with no issues, I read the Electron 20 has changed the memory handling so it might have this effect.
Hi I've narrowed the issue on my side to the entitlements files
With electron 20+ the result application can't be launched on Apple Silicone
Gist here https://gist.github.com/idanwork/b5ce9b6af0b2ac944c387cc2e9f67673
When packing with electron 19 or not including the entitlements files
When including entitlements & packed it'll crash on Apple Silicone
Note that the same entitlements are used in both cases (electron 19 & 20)
Just a heads-up to confirm that the comment above is indeed right. I dropped the entitlments.plist file from my package.json and successfully ran the ARM64 version of my app with Electron 20. So this might be a good workaround, unless you really need entitlments.
These are my two entitlement files. AFAICT, the child one needs to inherit
and not be a direct copy of the main entitlements. My arm64 app builds and runs completely fine when building on an M1, same with x64, and universal builds: all work correctly for me
entitlements: "installer/mac/main.entitlements",
entitlementsInherit: "installer/mac/Upwork.entitlements",
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<false/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<false/>
</dict>
</plist>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.inherit</key>
<true/>
</dict>
</plist>
I ran into the same issue and found that adding the com.apple.security.cs.allow-jit
entitlement fixed the issue:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
</dict>
</plist>
This is in the Electron docs at https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds but didn't seem to be necessary before Electron 20.
I confirm the comment above solved the issue for me : the ARM64 version I built did work again.
This wasn't easy to diagnose, maybe putting it in electron-builder's documentation (or a link to the relevant part of Electron's docs) would be nice.
@AxelTerizaki please consider opening a PR for adding that to the documentation when you have a chance :) It's located in the docs
folder (or can be added in the jsdocs Configuration
class)
I ran into the same issue and found that adding the
com.apple.security.cs.allow-jit
entitlement fixed the issue:<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>com.apple.security.cs.allow-jit</key> <true/> </dict> </plist>
This is in the Electron docs at https://www.electronjs.org/docs/latest/tutorial/code-signing#signing--notarizing-macos-builds but didn't seem to be necessary before Electron 20.
After days of trying, chanced upon this which worked like a charm. Thanks.
I'm building my app for both arm64 and x64. I was only building for x64 until now because I use other binaries I bundle wiht my app, but I managed to get native arm64 versions of those (or universal) so I'm now trying to build both x64 and arm64 versions of my app bundle (not universal.)
Problem is, the x64 version works, but not the arm64 one. I get a "trap" signal crash when launching the ARM64 one.
Here in a terminal :
Or here on screen (to get the complete error log) :
I'd like to know where I should be searching first. I noticed there was a similar-sounding issue in #6962 but my productName and executableName are the same and I don't see any message with a missing helper.
Note that starting my app with the Electron runtime (
electron .
) works fine, so I think it has something to do with the build process somehow.Here's my electron builder config (I've cut the non mac stuff)
Does anyone have a clue of where I could search to try to fix this? Or encountered the same kind of issue?
Thanks in advance!