Open HuakunShen opened 2 weeks ago
I just noticed these two lines:
Running [tauri_bundler::bundle::common] Command `codesign --force -s Developer ID Application: <User> (<Team ID>) --keychain tauri-build.keychain --options runtime /Users/Dev/Dev/projects/Jarvis/target/release/bundle/macos/jarvis.app/Contents/MacOS/jarvis`
Developer ID Application: <User> (<Team ID>): ambiguous (matches "Developer ID Application: <User> (<Team ID>)" and "Developer ID Application: <User> (<Team ID>)" in /Users/Dev/Library/Keychains/login.keychain-db)
Are there two certificates with the same name in your keychain?
@pewsheen I think so. Does the name have to be unique?
Yeah, it is using the name to get the certificate. It can’t decide which one to use if there are two identical names.
I removed the certificates on my mac, also reset keychain, now getting new error.
Warning: unable to build chain to self-signed root for signer
keychain tauri-build.keychain --options runtime /Users/user/Dev/projects/devclean/devclean-ui/src-tauri/target/release/bundle/macos/devclean-ui.app/Contents/MacOS/devclean-ui`
/Users/user/Dev/projects/devclean/devclean-ui/src-tauri/target/release/bundle/macos/devclean-ui.app/Contents/MacOS/devclean-ui: replacing existing signature
Warning: unable to build chain to self-signed root for signer "Developer ID Application: <User> (<Team ID>)"
/Users/user/Dev/projects/devclean/devclean-ui/src-tauri/target/release/bundle/macos/devclean-ui.app/Contents/MacOS/devclean-ui: errSecInternalComponent
Error [tauri_cli_node] failed to bundle project: failed to sign app
I am not familiar with the code signing process.
Do I have to install some certificate for this to work?
I also tried to code sign in a clean macos VM also didn't work, and there is no meaningful error message.
Bundling devclean-ui.app (/Users/<user>/Downloads/devclean-main/devclean-ui/src-tauri/target/release/bundle/macos/devclean-ui.app)
Signing with identity "Developer ID Application: <User> (<Team ID>)"
Info setup keychain from environment variables...
Info Signing app bundle...
Signing /Users/<user>/Downloads/devclean-main/devclean-ui/src-tauri/target/release/bundle/macos/devclean-ui.app/Contents/MacOS/devclean-ui
Error failed to bundle project: failed to sign app
Did you use the certificate that was downloaded from Apple Developer > Certificates?
Can you bundle the app by using APPLE_SIGNING_IDENTITY="-" pnpm tauri build
?
I am having very weird and inconsistent problem when building and code sign a Tauri app on Mac.
I have certificate and passwords from a previous app that could code sign, and I also generated a new set of certificate and passwords for current project. Let me call them
ENV-old
andENV-new
.I could not code sign my current app locally with either ENV-old or ENV-new. If I use github action CI, ENV-new doesn't work, but ENV-old work.
I also Tried both set of credentials on my previous project. Both ENV-old and ENV-new don't work locally. and only ENV-old works in GitHub Action.
I did check whether there are new terms to sign on Apple's website. I did try to code sign a brand new tauri app.
What could be wrong with the certificates? They are newly generated following https://tauri.app/v1/guides/distribution/sign-macos/
Here is the log I get with
npm run tauri build --verbose
, but I can't see the reason this failed.