Closed r0hin closed 1 year ago
i've got same problem
Same problem here
EDIT: Tried installing the XCode beta, no difference
The accepted answer here might explain it (builds made on a beta version of MacOS aren't accepted) https://developer.apple.com/forums/thread/682597
Stapling works just fine if you skip '-v' arg for 'xcrun stapler staple' that is used within notarize() as last step, as there's no option to skip stapling I just added a catch for quick workaround:
try {
await electronNotarize.notarize({ ... })
} catch (error) {
if (error.message?.includes('Failed to staple')) {
spawn(`xcrun`, ['stapler', 'staple', appPath])
} else {
throw error
}
}
Thanks @ragauskl and the final build after notarization and stapling works fine on Monterey and earlier?
Worked for me on Monterey (built on laptop with Ventura and tested on different computer with Monterey), but haven't tested anything older than that.
My guess would be that it should not cause issues as problem is more likely on beta OS with the validation logic/recognising .app file as a valid file format for stapling, and not a problem with stapling itself
Worked for me too! Here's my approach with spawnSync and status-checking and output:
if (error.message?.includes('Failed to staple')) {
console.log('RETRY staple as per https://github.com/electron/electron-notarize/issues/109#issuecomment-1213359106');
const result = spawnSync('xcrun', ['stapler', 'staple', appPath]);
console.log('STDOUT: ', result.stdout.toString());
console.log('STDERR: ', result.stderr.toString());
if (result.status !== 0) {
throw new Error(
`RETRY: Failed to staple your application with return status: ${result.status}`,
);
}
console.log('RETRY: staple succeeded');
} else {
throw error;
}
Duplicate of #31
Not working for me electron-builder 24.6.3 electron 25.0.1
error thown
CloudKit query for hrms.app (2/ab4c9d44868c551e173029342b41d4b38ad024f2) failed due to "Record not found". Could not find base64 encoded ticket in response for 2/ab4c9d44868c551e173029342b41d4b38ad024f2 The staple and validate action failed! Error 65.
JSON Response is: { records = ( { reason = "Record not found"; recordName = "2/2/081ef50fe92295985a30a12db7dd0acc5d0fe377"; serverErrorCode = "NOT_FOUND"; } ); } CloudKit query for xyz.app (2/081ef50fe...) failed due to "Record not found". Could not find base64 encoded ticket in response for 2/081ef50... The staple and validate action failed! Error 65. failedTask=build stackTrace=Error: Failed to staple your application with code: 65
`require('dotenv').config(); const { notarize } = require('@electron/notarize');
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.bundleId',
appPath: ${appOutDir}/${appName}.app
,
appleId: appid
,
appleIdPassword: abc
,
teamId: 123
});
};`
I have multiple certifcates for different projects
I am trying to notarize the MacOS distributions of my application using the
afterSign
field forelectron-builder
, and have been receiving the following error:The code I am running in my notarization script is:
The dependency versions are:
I am running MacOS Ventura 13.0 Developer Beta 2 which could have something to do with it.
Thank you for your help!