notarize icon indicating copy to clipboard operation
notarize copied to clipboard

skipped macOS notarization reason=`notarize` options were not provided

Open ndtreviv opened this issue 1 year ago • 2 comments

I'm getting this output from electron-builder, and I'm not sure what it means, exactly.

Here's the relevant section of my package.json:

  "build": {
    "appId": "com.example.MyApplication",
    "afterSign": "electron/notarize.js",
    "asarUnpack": [ ... ],
    "publish": { ... },
    "files": [
      "build/**/*",
      "node_modules/**/*"
    ],
    "mac": {
      "category": "public.app-category.productivity",
      "icon": "build/icons/icon.icns",
      "hardenedRuntime": true,
      "gatekeeperAssess": false,
      "entitlements": "build/entitlements.mac.plist",
      "entitlementsInherit": "build/entitlements.mac.plist",
      "provisioningProfile": "embedded.provisionprofile"
    },
    "dmg": {
      "sign": false
    }
    ...
  },

The electron/notarize.js file looks like this:

require('dotenv').config();
const { notarize } = require('@electron/notarize');

const password = '@keychain:EE_PASSWORD';

exports.default = async function notarizing (context) {
  const { electronPlatformName, appOutDir } = context;
  if (electronPlatformName !== 'darwin') {
    return;
  }

  const appName = context.packager.appInfo.productFilename;

  return await notarize({
    appBundleId: 'com.example.MyApplication',
    appPath: `${appOutDir}/${appName}.app`,
    appleId: process.env.APPLE_ID,
    appleIdPassword: password,
    teamId: process.env.TEAM_ID
  });
};

So...what option did I not provide?

ndtreviv avatar Jan 16 '24 16:01 ndtreviv

Facing the same issue

cloudsolace avatar Jan 21 '24 07:01 cloudsolace

From my understanding you can feed a notarize object inside the mac config (check the electron builder docs, some params must be passed from env variables).

Using a customg js is an alternative.

vitto32 avatar Jan 22 '24 15:01 vitto32

I'm getting the same message

kai-shimada avatar Jan 26 '24 10:01 kai-shimada

Getting the same message -- it seems to still be notarizing though, I think? The application opens as expected anyway. Possibly an incorrect log?

dMARLAN avatar Feb 14 '24 08:02 dMARLAN

AFAIK if you are using electron-builder you can either:

  1. use the "notarize" procedure handled by electron-builder via configuration (see docs) OR
  2. use electron-notarize directly in the after-sign hook.

If you chose the latter (as I did) you'll get the "skipped macOS notarization" warning by electron-builder because you are skipping the built-in procedure (1). Built-in procedure requires you to pass few arguments via env variables and others via config. I had problems debugging it so I used path 2.

vitto32 avatar Feb 14 '24 09:02 vitto32

AFAIK if you are using electron-builder you can either:

  1. use the "notarize" procedure handled by electron-builder via configuration (see docs) OR
  2. use electron-notarize directly in the after-sign hook.

If you chose the latter (as I did) you'll get the "skipped macOS notarization" warning by electron-builder because you are skipping the built-in procedure (1). Built-in procedure requires you to pass few arguments via env variables and others via config. I had problems debugging it so I used path 2.

Thank you. Looks like I can safely ignore it then, possibly we can also set notarize: False which I expect will either hide the error or display something else a bit more clear.

dMARLAN avatar Feb 14 '24 09:02 dMARLAN

Can someone please provide an example of notarize property in electron.manifest.json?

nazar322 avatar Feb 15 '24 12:02 nazar322

AFAIK if you are using electron-builder you can either:

  1. use the "notarize" procedure handled by electron-builder via configuration (see docs) OR
  2. use electron-notarize directly in the after-sign hook.

If you chose the latter (as I did) you'll get the "skipped macOS notarization" warning by electron-builder because you are skipping the built-in procedure (1). Built-in procedure requires you to pass few arguments via env variables and others via config. I had problems debugging it so I used path 2.

Thank you. Looks like I can safely ignore it then, possibly we can also set notarize: False which I expect will either hide the error or display something else a bit more clear.

Yes! This does make sense now.

Running this command against my built app indicates that it is, indeed notarised:

spctl --assess -vv --type install MyApp.app

Closing this issue now.

ndtreviv avatar Feb 15 '24 12:02 ndtreviv