Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notarize fail #193

Open
heyikang opened this issue May 6, 2024 · 6 comments · May be fixed by #194
Open

Notarize fail #193

heyikang opened this issue May 6, 2024 · 6 comments · May be fixed by #194
Labels
bug Something isn't working

Comments

@heyikang
Copy link

heyikang commented May 6, 2024

^Error: Failed to display codesign info on your application with code: 1

xxxxx.app: host has no guest with the requested attributes

Failed to codesign your application with code: 1

xxxxx.app: host has no guest with the requested attributes

xxxxx.app: host has no guest with the requested attributes

Mac-mini app % certtool y | grep Developer\ I

output
Common Name : Developer ID Certification Authority
Common Name : Developer ID Certification Authority
Common Name : Developer ID Application: UserName (TeamId)

image image image
@heyikang
Copy link
Author

heyikang commented May 7, 2024

image

@heyikang
Copy link
Author

heyikang commented May 7, 2024

image

@heyikang
Copy link
Author

heyikang commented May 7, 2024

It is also possible to pass an absolute path to codesign

@heyikang
Copy link
Author

heyikang commented May 7, 2024

image

@heyikang
Copy link
Author

heyikang commented May 9, 2024

image

Notarized

@heyikang heyikang linked a pull request May 9, 2024 that will close this issue
@erickzhao erickzhao added the bug Something isn't working label Jun 6, 2024
kangfenmao added a commit to kangfenmao/cherry-studio that referenced this issue Aug 28, 2024
@kelsin
Copy link

kelsin commented Nov 10, 2024

Since this was blocking me I ended up replacing @electron/notarize with a very simple (but no error handling for now) script. In my package.json I have:

"build": {
  "mac": {
    "notarize": false
  },
  "afterSign": "electron/notarize.js"
}

as normal. This is the same as if you are writing your own custom @electron/notarize script. My script however is just:

import { execSync } from "node:child_process";

async function notarizing(context) {
  const { electronPlatformName, appOutDir } = context;

  if (electronPlatformName !== "darwin") {
    return;
  }

  if (!process.env.APPLEIDPASS) {
    return;
  }

  const appName = context.packager.appInfo.productFilename;
  const appPath = `${appOutDir}/${appName}.app`;
  const zipPath = `${appOutDir}/${appName}.zip`;
  const appleId = process.env.APPLE_ID;
  const appleIdPassword = process.env.APPLEIDPASS;
  const teamId = process.env.APPLE_TEAM_ID;

  console.log(
    execSync(`ditto -c -k --keepParent "${appPath}" "${zipPath}"`, {
      encoding: "utf8",
    }),
  );

  console.log(
    execSync(
      `xcrun notarytool submit "${zipPath}" --team-id "${teamId}" --apple-id "${appleId}" --password "${appleIdPassword}" --wait`,
      { encoding: "utf8" },
    ),
  );

  console.log(
    execSync(`xcrun stapler staple "${appPath}"`, { encoding: "utf8" }),
  );
}

export default notarizing;

Use as your own risk and make sure to check what environment variables you are using for CI/etc. This is working in my github actions and now my app is being packaged and notarizing again. Clearly the current logic used to run codesign with only the app bundle basename is not working. Until @electron/notarize updates to fix things I'll be using this.

erickzhao added a commit to heyikang/notarize that referenced this issue Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants