尝试在 Mac 上使用 electron-builder 和代码签名构建我的电子应用程序时出现此错误。身份在钥匙串上正确设置。
Error: Command failed: codesign --sign Company Name --force /Users/nterms/Projects/my-app/dist/mac/MyApp.app/Contents/Resources/app.asar.unpacked/node_modules/electron-prebuilt/dist/Electron.app/Contents/Frameworks/Electron Framework.framework
/Users/nterms/Projects/my-app/dist/mac/MyApp.app/Contents/Resources/app.asar.unpacked/node_modules/electron-prebuilt/dist/Electron.app/Contents/Frameworks/Electron Framework.framework: bundle format unrecognized, invalid, or unsuitable
at ChildProcess.exithandler (child_process.js:213:12)
at emitTwo (events.js:87:13)
at ChildProcess.emit (events.js:172:7)
at maybeClose (internal/child_process.js:827:16)
at Socket.<anonymous> (internal/child_process.js:319:11)
at emitOne (events.js:77:13)
at Socket.emit (events.js:169:7)
at Pipe._onclose (net.js:477:12)
From previous event:
at tsAwaiter (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
at MacPackager.sign (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/macPackager.ts:100:75)
at /Users/saranga/Projects/my-app/node_modules/electron-builder/src/macPackager.ts:80:26
From previous event:
at MacPackager.<anonymous> (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/macPackager.ts:80:10)
at next (native)
From previous event:
at tsAwaiter (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/util/awaiter.ts:10:47)
at Object.build (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/builder.ts:195:52)
at Object.<anonymous> (/Users/nterms/Projects/my-app/node_modules/electron-builder/src/build-cli.ts:27:28)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Function.Module.runMain (module.js:441:10)
at startup (node.js:139:18)
at node.js:968:3
但是,在没有代码签名的情况下打包时,该构建可以在同一个应用程序上顺利进行。
我在装有 OSX El Captain (10.11.6) 的 Mac 上,XCode 已更新到最新版本。
任何帮助是极大的赞赏。