Electron-osx-sign: Error: exit code: null.

Created on 14 Dec 2016  路  21Comments  路  Source: electron/electron-osx-sign

```macOS Sierra
version 10.12.1

Electron v1.4.12
electron-builder: 7.26.0


I'm getting this error now while trying to sign my app:

Error: Exit code: null. Command failed: codesign --sign Developer ID Application: * () --force /Users//Documents/*/dist/mac/.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework

at /Users/*/Documents/*/node_modules/electron-osx-sign-tf/util.js:69:16
```

bug

All 21 comments

Duplicates https://github.com/electron-userland/electron-builder/issues/956

electron-prebuilt/electron must be not in your app dependencies.

And please use latest electron-builder version.

electron-builder: 10.8.0

getting same error just at different location
at /Users/****/Documents/****/node_modules/electron-macos-sign/util.js:69:16

when i run codesign directly on that file i get this output:

Trace/BPT trap: 5

any ideas what it might be? I have updated from el capitan to sierra today

Hi @iggyZiggy I am not very sure what caused codesign to return null unexpectedly without throwing any side errors. Have you updated your Xcode after upgrading to Sierra?

yeah, updated the big xcode of 4,5gb and the command line tools (forgot what's the name of it) too, didn't help. Is there a way to reinstall codesign, this is a strange one and i have reinstalled pretty much everything, including electron, dependencies, don't know what else to try to solve this

@iggyZiggy mhm... Would you like to first try export DEBUG=electron-osx-sign* and post a copy of the debug log here before reinstalling any components for Xcode? Probably some stderr is caught by this module while displaying null.

Signing app (identity: Developer ID Application: My Company Name (ID0FM4C0MP))

  electron-osx-sign `identity` passed in arguments. +0ms
  electron-osx-sign Executing security find-identity -v +8ms
  electron-osx-sign   1) ***
  2) ***
  3) ***
  4) ***
  5) ***
  6) ***
  7) ***
     7 valid identities found
 +722ms
  electron-osx-sign Identity: 
 > Name: Developer ID Application: My Company Name (ID0FM4C0MP) +1ms
  electron-osx-sign Identity: 
 > Name: Developer ID Application: My Company Name (ID0FM4C0MP) +0ms
  electron-osx-sign Identity: 
 > Name: Developer ID Application: My Company Name (ID0FM4C0MP) +0ms
  electron-osx-sign:warn Multiple identities found, will use the first discovered. +0ms
  electron-osx-sign:warn No `entitlements` passed in arguments: 
 * Provide `entitlements` to specify entitlements file for codesign. +1ms
  electron-osx-sign Pre-sign operation enabled for provisioning profile: 
 * Disable by setting `pre-embed-previsioning-profile` to `false`. +0ms
  electron-osx-sign Pre-sign operation enabled for entitlements automation with versions >= `1.1.1`: 
 * Disable by setting `pre-auto-entitlements` to `false`. +0ms
  electron-osx-sign:pre-embed-provisioning-profile No `provisioning-profile` passed in arguments, will find in current working directory and in user library... +2ms
  electron-osx-sign:pre-embed-provisioning-profile No provisioning profile found, will not embed profile in app conte
nts. +3ms
  electron-osx-sign Signing application... 
 > Application: /Users/myusername/Documents/mproject/dist/mac/ProjectName.app 
 > Platform: darwin 
 > Entitlements: undefined 
 > Child entitlements: undefined 
 > Additional binaries: undefined 
 > Identity: Developer ID Application: My Company Name (ID0FM4C0MP) +2ms
  electron-osx-sign Walking... /Users/myusername/Documents/mproject/dist/mac/ProjectName.app/Contents +2ms
  electron-osx-sign Signing... /Users/myusername/Documents/mproject/dist/mac/ProjectName.app/Contents/Frameworks/Electr
on Framework.framework/Versions/A/Electron Framework +75ms
  electron-osx-sign Executing codesign --sign Developer ID Application: My Company Name (ID0FM4C0MP) --force /Users/m
yusername/Documents/mproject/dist/mac/ProjectName.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Elect
ron Framework +0ms
Error: Exit code: null. Command failed: codesign --sign Developer ID Application: My Company Name (ID0FM4C0MP) --forc
e /Users/myusername/Documents/mproject/dist/mac/ProjectName.app/Contents/Frameworks/Electron Framework.framework/Versio
ns/A/Electron Framework

    at /Users/myusername/Documents/mproject/node_modules/electron-macos-sign/util.js:69:16
    at ChildProcess.exithandler (child_process.js:214:5)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5)

@iggyZiggy would you try manually sign this component with the following script and see if it runs?

codesign --sign "Developer ID Application: My Company Name (ID0FM4C0MP)" --force "/Users/myusername/Documents/mproject/dist/mac/ProjectName.app/Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework"
Segmentation fault: 11

tried setting --timestamp=none and got the:

Trace/BPT trap: 5

again

@iggyZiggy Just looked up on Google 馃槙 would you then try to generate a new certificate and see if signing works?

already tried that too, even if i delete old certificates and import new one, when i run
security find-identity
i get like 4 duplicates

@iggyZiggy well, I guess we may have to install use xcode-select --install to install the command line tools (just to confirm that the latest tools are installed) and check the updates in Mac App Store (which doesn't sound helpful)... Otherwise I'm not sure what exactly causes this issue. 馃槙

already did that too, when it didn't work i downloaded full xcode (the 4.5gb one), I'll try again... I really hate apple right now, wasted 3 days trying to sign a damn app, really a $100 worth experience, even bought the mac-mini only for this purpose

tried removing command line tools completely and installing them again, didn't help. When i removed them they showed up in mac app store updates, installed them with xcode-select --install. I'm running out of ideas

fixed it, after reinstalling everything, deleting everything (including certificates for verification) and starting fresh with new csr, different common name, moving certificate from login to system keychains with both private and pub key (named by inputed common name in csr) it managed to sign everything without any errors

馃槩 those are a lot of steps you took... I feel sorry that you have to deal with codesign after long working on the app already. However, glad that your managed to pass that signing component.

@iggyZiggy Is your app up and running now after code signing (like without freezing or white screen)?

@sethlu yeah, works great, just tested autoUpdater and that works great now, gonna help some people on other issue now :)

@iggyZiggy Awesome!

For anyone else who has the same problem - I eventually solved this by copying my cert from the System to login keychain (just dragging in Keychain Access). This only started happening when I upgraded to Sierra.

Is this actually maybe a bug?

@tom-james-watson As electron-osx-sign uses codesign to sign the app bundle, login.keychain is used by default by codesign; however, --keychain option is available from electron-osx-sign that we can pass the keychain containing the signing identities to codesign. Hope this clarifies the usage. 馃樃

Was this page helpful?
0 / 5 - 0 ratings