Electron-builder: Command failed: codesign --sign error caused when trying to build electron mac build

Created on 27 Feb 2018  路  7Comments  路  Source: electron-userland/electron-builder

Hello guys,
Im new to electron build and i found below error when im create electron mac build from mac.

Error: Command failed: codesign --sign D8BXXXXXXXXXXXXXX --force /Users/wos/Desktop/APP-Mac/dist/mac/APP.NAME.app
/Users/wos/Desktop/APP-Mac/dist/mac/APP.Today.app: resource fork, Finder information, or similar detritus not allowed

at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)

From previous event:
at MacPackager.sign (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/macPackager.js:286:11)
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/macPackager.ts:94:26
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/macPackager.ts:94:10
at Generator.next ()
From previous event:
at MacPackager.pack (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/macPackager.js:209:11)
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/packager.ts:372:24
at Generator.next ()
at xfs.stat (/Users/wos/Desktop/Hawala-Mac/node_modules/fs-extra-p/node_modules/fs-extra/lib/mkdirs/mkdirs.js:56:16)
at /Users/wos/Desktop/Hawala-Mac/node_modules/graceful-fs/polyfills.js:287:18
at FSReqWrap.oncomplete (fs.js:153:5)
From previous event:
at Packager.doBuild (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/packager.js:441:11)
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/packager.ts:316:52
at Generator.next ()
at /Users/wos/Desktop/Hawala-Mac/node_modules/graceful-fs/graceful-fs.js:99:16
at /Users/wos/Desktop/Hawala-Mac/node_modules/graceful-fs/graceful-fs.js:43:10
at FSReqWrap.oncomplete (fs.js:135:15)
From previous event:
at Packager._build (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/packager.js:385:11)
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/packager.ts:278:23
at Generator.next ()
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
at Packager.build (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/packager.js:341:11)
at /Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/src/index.ts:50:40
at Generator.next ()
From previous event:
at build (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder-lib/out/index.js:47:21)
at build (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder/src/builder.ts:228:10)
at then (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder/src/cli/cli.ts:48:33)
at runCallback (timers.js:789:20)
at tryOnImmediate (timers.js:751:5)
at processImmediate [as _immediateCallback] (timers.js:722:5)
From previous event:
at Object.args [as handler] (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder/src/cli/cli.ts:48:33)
at Object.runCommand (/Users/wos/Desktop/Hawala-Mac/node_modules/yargs/lib/command.js:235:44)
at Object.parseArgs [as _parseArgs] (/Users/wos/Desktop/Hawala-Mac/node_modules/yargs/yargs.js:1042:24)
at Object.get [as argv] (/Users/wos/Desktop/Hawala-Mac/node_modules/yargs/yargs.js:957:21)
at Object. (/Users/wos/Desktop/Hawala-Mac/node_modules/electron-builder/src/cli/cli.ts:42:15)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Hawala.[email protected] dist: build
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Hawala.[email protected] dist script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/wos/.npm/_logs/2018-02-27T03_45_17_931Z-debug.log

backlog

Most helpful comment

ran xattr -cr * at the root of my source code to remove all the crud and rebuilt and it worked.

https://github.com/electron-userland/electron-builder/issues/2125

All 7 comments

Same with me

I'm also getting a weird error.
/Electron Framework: bundle format is ambiguous (could be app or framework)

anyone find a solution?

I have to downgrade electron-builder to 19.45.0 and electron-updater to 2.14.0:
npm install [email protected] [email protected]

ran xattr -cr * at the root of my source code to remove all the crud and rebuilt and it worked.

https://github.com/electron-userland/electron-builder/issues/2125

I've run across this a few different ways:

  • various build junk (as @hoythan mentioned)
  • app being built is open or is still being held by a zombie process
  • trying to pack certain filetypes into the asar instead of adding to ExtraFiles or ExtraResources

For cleaning build artifacts I would suggest using xattr -cr . in your project root instead of a wildcard *, so to make sure and get all hidden directories and files as well. You'll notice the command taking much more time, and much more prone to fix the issue, if it is an artifact.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings