electron-builder: Notarize failed with 24.13.3 after upgrade from 24.12.0 with app specific password
- Electron-Builder Version: 24.13.3
- Node Version: 18.18.2
- Electron Version: 28.2.5
- Electron Type (current, beta, nightly): stable
- Target: macos-12 dmg darwin-64
I upgraded electron builder from 24.12.0 to 24.13.3 and notarizing failed with
Cannot destructure property 'appBundleId' of 'options' as it is undefined.
I am using APPLE_ID and APPLE_APP_SPECIFIC_PASSWORD approach for authorization. Since i did not find out what changed, i tried to force new notarytool.
I checked the code how notarize options are build. And it should be possible to set
{
mac: {
notarize: {
teamId: "TEAM_ID"
}
}
}
even when using apple id and app specific password for authorization. the new notarytool should be used following the source code in https://github.com/electron-userland/electron-builder/blob/master/packages/app-builder-lib/src/macPackager.ts#L566. But when setting the team id i get this:
-> Options related to how build macOS targets.
Details:
* configuration.mac.notarize has an unknown property 'teamId'. These properties are valid:
object { appBundleId?, ascProvider? }
* configuration.mac.notarize has an unknown property 'tool'. These properties are valid:
object { appBundleId?, ascProvider? }
* configuration.mac.notarize has an unknown property 'tool'. These properties are valid:
object { teamId }
* configuration.mac.notarize misses the property 'teamId'. Should be:
string
-> The team ID you want to notarize under for when using `notarytool`
So what did i miss in the version update that notarizing is not working anymore?
Thank you!
EDIT: Downgraded to 24.12.0 again and removed the notarize key from the builder config. and it is working again.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 6
- Comments: 15 (4 by maintainers)
Commits related to this issue
- Revert "Bump `electron-builder` to 24.13.3" This reverts commit d2b131370bc3922ec094c213d8df2d361ddcc38f. See: https://github.com/electron-userland/electron-builder/issues/8103 — committed to cirras/eomap-js by cirras 3 years ago
- Setting fixed electron-builder version due to issue in recent update https://github.com/electron-userland/electron-builder/issues/8103 — committed to ChurchApps/FreeShow by vassbo 3 years ago
- Remove afterSign script to fix https://github.com/electron-userland/electron-builder/issues/8103 — committed to gethubai/hubai-desktop by mtsdnz 3 years ago
- chore: fix codesigning on macOS binaries related issue: https://github.com/electron-userland/electron-builder/issues/8103 Signed-off-by: Florent Benoit <fbenoit@redhat.com> — committed to podman-desktop/podman-desktop by benoitf 2 years ago
- chore: fix codesigning on macOS binaries related issue: https://github.com/electron-userland/electron-builder/issues/8103 Signed-off-by: Florent Benoit <fbenoit@redhat.com> — committed to amisskii/podman-desktop by benoitf 2 years ago
I hit the same issue that reported here.
Newer electron-builder has a built-in
notarizeoption that works out of the box as @KillerCodeMonkey mentioned. On the other hand, the old way that uses theafterSignoption to invoke a script to manually callelectron-notarizedoesn’t work well with electron-builder 24.13.3.I removed the
afterSignoption in my script and added the following config topackage.jsonand now everything works without issues. I’m still usingAPPLE_APP_SPECIFIC_PASSWORD, but it looks that’s just fine.If you have the following env variables, it will try to notarize automatically
What a guessing game.
How so?
I am still using this approach and it works fine. Just ensure to set
build.mac.notarizetofalsein package.json, to avoid attempting it twice.Here is my
afterSign.jsfile, set inbuild.afterSign. Note that I load the credentials from a file usingdotenv; I do not pass them via runtime environment variables:I also had to downgrade to get things rolling again.
It seems that in
v24.13.3, notarize is being called somewhere while disregarding the script specified byafterSign.The error I was getting:
Cannot destructure property 'appBundleId' of 'options' as it is undefined. failedTask=build stackTrace=TypeError: Cannot destructure property 'appBundleId' of 'options' as it is undefined..It seems like this “other”
notarizeis being called based on a trigger other than theafterSignconfig.