electron / osx-sign

Codesign Electron macOS apps
BSD 2-Clause "Simplified" License
558 stars 96 forks source link

Cannot push to Appstore Connect #279

Closed hayr-hotoca closed 1 year ago

hayr-hotoca commented 1 year ago

I use the JS API to sign the .app file with sandbox enabled in the entitlements file then convert to .pkg file. I then use my Developer ID Installer certificate to sign the .pkg to upload to Appstore Connect.

When verifying the signed pkg file on the Transporter app, it gives 300 errors of Asset validation failed (90285, 90287, 90237, 90266, ) Invalid Code Signing Entitlements. Your application bundle's signature contains code signing entitlements that are not supported on macOS. Specifically, key '...' in ... is not supported.Entitlements

const { signAsync } = require('@electron/osx-sign')
signAsync({
  app: '/Users/macbookpro/Desktop/project/build/mac/myApp.app',
  identity: 'Apple Distribution',
  optionsForFile: optionsForFile
})
  .then(function () {
    // Application signed
    console.log('done');
  })
  .catch(function (err) {
    // Handle the error
    console.log(err);
  });

  function optionsForFile() {
    return {entitlements: '/Users/macbookpro/Desktop/project/mac.entitlements.plist'};
  }