question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macOS Hardened runtime, notarization, code signing: app crashes and doesn't work at all

See original GitHub issue

Which version of electron-builder are you using?

  • Version: 20.44.4

Which version of electron are you using?

  • Version: 4.2.4

What target are you building for?

  • Target: mac (dmg)

I’m trying to enable notarization in my app to support OSX 10.14.5, but even after following the many related issues submitted by others, the process still doesn’t work correctly for me: the notarization process completes successfully (which is even confirmed by spctl -a -v Test.app and codesign --verify -vv Test.app) but when I run the app on a newer mac with OSX 10.14.5 the app crashes with the following error:

Exception Type: EXC_BAD_ACCESS (Code Signature Invalid) Exception Codes: 0x0000000000000032, 0x00000ae52f684040 Exception Note: EXC_CORPSE_NOTIFY

Termination Reason: Namespace CODESIGNING, Code 0x2 […] Thread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 ??? 0x00000ae52f684040 0 + 11979459149888 1 com.github.Electron.framework 0x0000000106ff8a01 0x105c32000 + 20736513

Note that the app runs fine on older OSX versions that do not have the notarization requirement.

What I tried: I followed this guide by @Kilian in the issue #3870 to add the necessary electron-notarize parts. I was already signing with a “Developer ID” key, so I just added entitlements, gatekeeperAssesment and hardenedRuntime to package.json and the notarize script. I’m building on a Mac Mini with OSX 10.13.6 (according to Apple seems to be the minimum accepted version for notarization support) with yarn 1.16

I even removed all the code from my app, leaving only console.log('Hello World!'); process.exit(0) but the app still crashes with the same error message. I tried adding every entitlment allowed, but still no progress I hope some of you can guide me to the correct direction.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:13
  • Comments:40 (8 by maintainers)

github_iconTop GitHub Comments

github_iconTop Results From Across the Web

App not launching after signing wi… | Apple Developer Forums
Exactly, the problem was that the app was crashing after signing with the hardened runtime enabled (notarization process was not involved yet). I've...
Read more >
Instruments crashes app with Hardened Runtime on macOS ...
I found two ways to fix this: Do not codesign with Hardened Runtime enabled - this is a good solution for debug builds, ......
Read more >
Getting Ready for macOS's Hardened Runtime and Notary
Security on macOS · Code Signing – On macOS GateKeeper requires application bundles to be cryptographically signed with a key from an Apple ......
Read more >
Hardened runtime for macOS - Lazarus wiki
Solution: Use the “com.apple.security.get-task-allow” entitlement on your debug build. Note: Running an application under a debugger will mask ...
Read more >
Enable Hardened Runtime through Xcode, App won't start
Open the project with Xcode, verify that clicking the "Build and Run"-Button let's you play the sample scene. Then go to the project...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found