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.

App does not launch after sign or I got a blank electron window (macOS 10.14.4)

See original GitHub issue

I need to sign my Electron application to submit to App Store. I tried with electron-osx-sign and the Mac App Store Submission Guide here, but with both I cannot open the application after signing.

I build my app with electron-packager using this command:

electron-packager . --app-bundle-id=my-bundle-id --helper-bundle-id=my-bundle-id.helper --app-version=1.1.22 --build-version=1.1.23 --platform=mas --arch=x64 --electron-version=3.0.4 --icon=assets/icons/mac/icon.icns --type=distribution --out=app-store --overwrite

After running this command I am able to open the .app file without problems. Then I try to sign the .app file and generate the .pkg file using these commands:

export DEBUG=electron-osx-sign* electron-osx-sign 'app-store/Tok-mas-x64/Tok.app' --entitlements='build/entitlements.mas.plist' --entitlements-inherit='build/child.plist' --identity='3rd Party Mac Developer Application: My Company (XXXXX)' --provisioning-profile='embedded.provisionprofile' --verbose

I got the following message in terminal: “Application signed: app-store/Tok-mas-x64/Tok.app

If I open the app file I got a blank electron window. If I run the following command

electron-osx-flat 'app-store/Tok-mas-x64/Tok.app' --entitlements='build/entitlements.mas.plist' --identity='3rd Party Mac Developer Installer: My Company (XXXXX)' --provisioning-profile='embedded.provisionprofile' --verbose

I got the .pkg file, that I am able to install successfully but then I cannot find the app between my applications. If I try to open the .app file, the app crashes with this error: “Termination Reason: Namespace CODESIGNING, Code 0x1”

I also tried signing manually, running this script

image

In the terminal I got this: /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/Frameworks/Electron Framework.framework: replacing existing signature /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/Frameworks/Tok Helper.app/: replacing existing signature /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/Library/LoginItems/Tok Login Helper.app/: replacing existing signature /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/MacOS/Tok: **code object is not signed at all** In subcomponent: /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/Frameworks/Tok Helper NP.app /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app: ### code object is not signed at all In subcomponent: /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app/Contents/Frameworks/Tok Helper NP.app productbuild: Adding component at /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.app productbuild: Signing product with identity "3rd Party Mac Developer Installer: My company (XXXX)" from keychain /Users/irisgaleano/Library/Keychains/login.keychain-db productbuild: Adding certificate "Apple Worldwide Developer Relations Certification Authority" productbuild: Adding certificate "Apple Root CA" productbuild: Wrote product to /Users/irisgaleano/Electron-projects/tok-electron/app-store/Tok-mas-x64/Tok.pkg productbuild: Supported OS versions: [10.9.0, )

The problems are similar. I got the .pkg file, that I am able to install successfully but then I cannot find the installed app. If I try to open the .app file, I got a blank electron window again.

These are my entitlements.

entitlements.mas.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.developer.aps-environment</key> <string>development</string> <key>com.apple.security.app-sandbox</key> <true/> <key>com.apple.security.application-groups</key> <string>my.bundle.id</string> <key>com.apple.security.files.downloads.read-write</key> <true/> <key>com.apple.security.files.user-selected.read-write</key> <true/> <key>com.apple.security.network.client</key> <true/> <key>com.apple.developer.team-identifier</key> <string>XXXX</string> <key>com.apple.security.cs.allow-unsigned-executable-memory</key> <true/> </dict> </plist>`

child.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.app-sandbox</key> <true/> <key>com.apple.security.inherit</key> <true/> </dict> </plist>`

loginhelper.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.app-sandbox</key> <true/> </dict> </plist>`

These are the cert.

image

electron: 3.0.4 electron-builder: 12.2.0 electron-osx-sign: 0.4.15

I tried this recommendation [#200] and this [#188] with not success.

Anyone can help me please? Thanks.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:2
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
axfelixcommented, Dec 14, 2020

Same problem here

1reaction
AndrewLangcommented, Feb 14, 2020

Got exactly same problem

Read more comments on GitHub >

github_iconTop Results From Across the Web

App does not launch after sign or I got a blank electron ...
I tried with electron-osx-sign and the Mac App Store Submission Guide here, but with both I cannot open the application after signing. I...
Read more >
electron mac build crashing on startup (signed and notarized)
The apps work perfectly and can be signed and notarized without any issues but when run on MacOS 10.14+ they crash with the...
Read more >
Electron js Electron builder mac built opening blank white ...
I was able to solve the issue with the use of logs by using const appLogs=require('electron-log'); appLogs.transports.console.level = false;.
Read more >
Mac problem-solving - The Eclectic Light Company
A list of articles to help you solve problems on Macs running Big Sur and Monterey (11-12). For older articles about previous versions...
Read more >
Etcher 1.5 problems on Mac - balenaEtcher - balena Forums
I installed Etcher v1.5 on my iMac (v10.14.3), but when I launch the app, nothing appears. I can quit the program and pull...
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