Could not code sign a Mac App

2019-05-06 18:42发布

问题:

I successfully submitted my app [ version 1.0 ] to iTunesConnect for review. And they have rejected it because I have added an extra App Sandbox feature. So I solved that thing and tried to archive my project in new build number.

Also I have selected my Code Signing Identity 3rd Party Mac Developer Application, And came back to Project Settings -> General, now I could see that the Signing switched to None and Team automatically changed to None. So I have changed that to My Team Name and Signing into Mac App Store. Now I have went back to Project Settings -> Build Settings, There the code signing identity has different identity selected [ Two Mac Developer & One 3rd Party Mac Developer ].

So what happens is that whenever I change something the opposite happen in other place. Basically I am unable to archive my project cause of code signing issue.

If I try to code sign using Mac Developer Identity, it shows me something that I never seen before.

Something like error: A cryptographic verification failure has occurred. *** error: Couldn't codesign /Users/Alvin/Library/Developer/Xcode/DerivedData/MyApp-bjtynsmrmxhrfffdvpfwxeanbgkb/Build/Intermediates/ArchiveIntermediates/MyApp/InstallationBuildProductsLocation/Applications/MyApp.app/Contents/Frameworks/libswiftCore.dylib: codesign failed with exit code 1

So how will I solve this problem? Thanks in advance.

By the way, I am using Xcode 7.3.1 in macOS Sierra. Is that can be a problem? No right?

回答1:

It seems there may be code signing issues with macOS Sierra. You can follow the issue here.

I would recommend reverting back to El Cap and only installing an early beta of a new Mac OS on a machine used for testing the OS, not one you are doing active development on.

[update 7/6/2016]

Some developers are reporting this fixed with macOS Sierra Beta 2 and Xcode 8 Beta 2, but I have not yet comfirmed on my spare Mac if this fixes the problem.

Also, some developers have reported that resetting the Keychain fixes is. In the Keychain Access app , go to "Preferences..." and click "Reset My Default Keychain".