问题描述
我正在尝试在 Mac 上公证我的 electron.js 应用程序。
代码签名成功,然后将.app
文件发送到服务器进行公证,但随后过程失败并出现错误(下面添加了错误)。
通过网上搜索,我发现此问题与 ascProvider
字段有关。
我将 ProviderShortName
与命令 xcrun altool --list-providers -u <APPLEID> -p <APP_PASSWORD>
一起添加到 ascProvider
,它应该修复了错误,但公证过程仍然失败。
是否还有其他可能来修复此错误?
我从公证中得到的错误
Your Apple ID account is attached to other providers. You will need to specify which provider you intend to submit content to. Please contact us if you have questions or need help. (1627)
2021-03-01 15:00:17.378 altool[48448:1515802] *** Error: Unable to notarize app.
2021-03-01 15:00:17.378 altool[48448:1515802] *** Error: code 1627 (Your Apple ID account is attached to other providers. You will need to specify which provider you intend to submit content to. Please contact us if you have questions or need help. (1627))
我的notarizing.js
是这样的
require('dotenv').config();
const { notarize } = require('electron-notarize');
const fs = require('fs');
const path = require('path');
exports.default = async function notarizing(params) {
const { electronPlatformName,appOutDir } = params;
if (electronPlatformName !== 'darwin') {
return;
}
console.log('afterSign hook triggered',params.targets);
// Same appId in electron-builder.
let appId = 'my.app.com'
let appPath = path.join(params.appOutDir,`${params.packager.appInfo.productFilename}.app`);
if (!fs.existsSync(appPath)) {
throw new Error(`Cannot find application at: ${appPath}`);
}
console.log(`Notarizing ${appId} found at ${appPath}`);
try {
await notarize({
appBundleId: appId,appPath: appPath,appleId: process.env.APPLEID,appleIdPassword: process.env.APPLEIDPASS,ascProvider: process.env.APPLEPROVIDER,});
} catch (error) {
console.error(error);
}
console.log(`Done notarizing ${appId}`);
};
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)