electron / notarize

Notarize your macOS Electron Apps
MIT License
128 stars 31 forks source link

Error when launching signed and notarized app - JavaScript error occurred in the main process #185

Closed michaelburris closed 3 months ago

michaelburris commented 4 months ago

When launching an app that has been osx signed and notarized I get the following error:

Uncaught Exception:
Error: Knex: run
$ npm install sqlite3 --save
dlopen(/var/folders/..., 0x0001): tried: '/var/folders/....' (code signature in <> '.....' not valid for use in process: mapping process and mapped file (non-platform) have different Team IDs), '......' (no such file)

I'm hoping someone has had to deal with this using knex.js and electronjs. The app works fine when its not notarized and signed.

Lsnsh commented 3 months ago

+1 same problem.

miketaheny commented 3 months ago

Same problem here. Either of you come up with a resolution? @michaelburris @Lsnsh

Lsnsh commented 3 months ago

Same problem here. Either of you come up with a resolution? @michaelburris @Lsnsh

@miketaheny After setting com.apple.security.cs.disable-library-validation, worked normally for me.

<key>com.apple.security.cs.disable-library-validation</key>
<true/>

https://developer.apple.com/forums/thread/126895

miketaheny commented 3 months ago

@Lsnsh - that worked thank you!

For anyone using electron forge this fixed the error with dlopen(.... different team Ids.

1. Add entitlements.plist to the root of your project. `<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

com.apple.security.cs.allow-unsigned-executable-memory com.apple.security.cs.disable-library-validation com.apple.security.cs.allow-jit ` **2.** In forge.config.js add this to osxSign: ` optionsForFile: (filePath) => { // Here, we keep it simple and return a single entitlements.plist file. // You can use this callback to map different sets of entitlements // to specific files in your packaged app. return { entitlements: './entitlements.plist' }; }`
michaelburris commented 3 months ago

@miketaheny @Lsnsh Thank you. Works as advertised.