electron-userland / electron-builder

A complete solution to package and build a ready for distribution Electron app with “auto update” support out of the box
https://www.electron.build
MIT License
13.61k stars 1.74k forks source link

Notarization for mac electron application(pkg,dmg) is not happening #8262

Open reddybhavanish opened 3 months ago

reddybhavanish commented 3 months ago

Hi Team, we made the following changes for the notarization of mac build 1.Changed xcode version to more than 13(as notarytool is supported only for the xcode more than 13) 2.Upgraded electron-builder version to latest 3.Changed this dependency "electron-notarize": "^1.0.0" to "@electron/notarize":2.3.2 4.Added tool:"notary tool" in the notarize.js 5.Changed ascProvider to teamId in notarize.js Here is the configuration in notarize.js await electron_notarize.notarize({ appPath: appPath, ascProvider: 'xxxx', appleId: 'xxxxxxx', appleIdPassword: 'xxxx', }); 6.Added additional field in package.json under build "build": { ... "mac": { ... "notarize": { "teamId": "YOUR_TEAM_ID_HERE" } }

after making the above changes we generated builds, it is showing notarization successful in the log, but while trying to install build files(pkg,dmg) in other mac systems the application isn't getting opened

@mmaietta can you please help us on this.

willemdjong commented 3 months ago

Exact same issue here ! Signing and notarization have been successful but unidentified developer after downloading and installing the app on mac.

mmaietta commented 3 months ago

@reddybhavanish it sounds like you are notarizing the application twice with the notarize.js and adding the notarize: { ... } in your electron-builder config. Can you please try using only one approach and write back?

reddybhavanish commented 3 months ago

Hey @mmaietta thanks for the reply, i tried as you said and removed "build": { ... "mac": { ... "notarize": { "teamId": "YOUR_TEAM_ID_HERE" } } from the package.json and verified whether the artifact is notarized or not with this command spctl -a -vv "path/to/output-directory/YourAppName.dmg" it showed rejected status, while in the log it showed notarization successful.

willemdjong commented 3 months ago

Hi,

We've experienced similar issues as mentioned in the previous posts, despite our notarization being successful.

To check the status of our app, we used the following command:

syspolicy_check distribution <AppName.app>

This morning, we discovered problems related to node-gyp and dynamic libraries. Fortunately, the issue has been resolved in a new version of node-gyp. We recommend using node-gyp 10.1.0. Since electron-builder uses an older version, the issue persists.

To fix this, you can override the node-gyp version in your packages by adding the following to your package.json:

"overrides": {
    "node-gyp": "10.1.0"
  }

We hope this resolves the issue for you as well.

reddybhavanish commented 3 months ago

Hey @willemdjong , we are not using any such dependency like node-gyp in our project. Do you recommend me using this ? if so what exactly does this do? please throw some light on this.

willemdjong commented 3 months ago

@reddybhavanish we encountered a similar issue with electron-builder, which uses node-gyp. By overriding the node-gyp version, we were able to resolve our problem with electron-builder. While I can't guarantee this is the exact issue you're facing, you might want to try the same approach. Overriding node-gyp shouldn't break electron-builder, but please note that it will affect all packages that depend on node-gyp.

github-actions[bot] commented 2 weeks ago

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 30 days.