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 pkg error: electron-builder attemps to code-sign a framework

See original GitHub issue
  • Version: 21.2.0 (not the latest version as it does not currently work on MacOS)
  • Target: MacOS pkg

Hi, We’re working on the MacOS version of an existing Windows app.

Everything works fine when code-signing is disabled. If code-signing is enabled, we get the following error:

⨯ Command failed: codesign --sign E0769897B5207F7E3FF79D46FCEFC98F84A212F3 --force --options runtime --entitlements installer/osx/entitlements.mac.plist /Users/merwan/Documents/MyApp/_bundles/mac/MyApp.app/Contents/Resources/app.asar.unpacked/someDependencyC.framework
/Users/merwan/Documents/MyApp/_bundles/mac/MyApp.app/Contents/Resources/app.asar.unpacked/someDependencyC.framework: bundle format unrecognized, invalid, or unsuitable

The app contains a native Node addon and some of its dependencies. They are asarUnpacked so here’s what’s inside of MyApp.App/Contents/Resources/app.asar.unpacked.

  • nodeAddon.node (our native addon)
  • someDependencyA.dylib (no issue with this one)
  • someDependencyB.dylib (no issue with this one)
  • someDependencyC.framework (library provided by a third party)

It seems that electron-builder attempts to sign the .framework, which fails.

1) Is this an expected behavior?

2) I noticed that there’s a Contents/Frameworks folder in the bundled app. Should I put our dependency there? If yes, how to instruct electron builder to do so?

Note: if we exclude the framework from the bundle and then, after everything is signed, we copy it manually in the app.asar.unpacked folder (or even in Content/Frameworks), there’s no signing error and the app works. I guesse we could do this with an afterSign script as a workaround but this is not obviously not ideal.

Thanks for your help,

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:9 (3 by maintainers)

github_iconTop GitHub Comments

16reactions
biancamacommented, Mar 23, 2020

I simply disabled automatic sign off aaplication export CSC_IDENTITY_AUTO_DISCOVERY=false

2reactions
appresorgcommented, Dec 18, 2020

$ export CSC_IDENTITY_AUTO_DISCOVERY=false $ npm run pack

Okey.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Invalid Code Signature Error on El… | Apple Developer Forums
I codesign via commandline using xcode 10.1 on Mac OS X 10.14.1. I've tried reducing the application down to the bare Electron startup,...
Read more >
Newest 'codesign' Questions - Stack Overflow
I'm getting this error: The code signature version is no longer supported when trying to run an app. This has to do with...
Read more >
How to build and notarize Electron apps on macoS? - Fora Soft
I began notarizing my apps and kept getting the Package Approved ... and codesign will have an error unrecognized option for that flag....
Read more >
All the Electron Docs! | Electron
Electron is an open source library developed by GitHub for building cross-platform desktop applications with HTML, CSS, and JavaScript. Electron accomplishes ...
Read more >
electron-npm-packages
A collection of all npm packages that mention `electron` in their package.json. Latest version: 4.1.2, last published: 5 years ago.
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