Failed to sign MacOS App

I was updating a Mac OS App.


As I had to change my appleID password, I was asked to recreate the signing information.


I may not remember everything, but at some point I was required revoke signing certificate ; then I was asked to enter keychain.

At the end I refused to access keychain.


And now, I'm locked, unable to compile the app, getting the following error:


error: Failed with exit code 1


here is an extract of the log


Probing signature of /Users/me/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib

/usr/bin/codesign -r- --display /Users/claudericaud/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib

Codesigning /Users/me/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib

/usr/bin/codesign --force --sign 2502A0C5446D7D46C14F1972CF87507125827533 --verbose /Users/me/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib

/Users/me/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib: replacing existing signature

/Users/me/Library/Developer/Xcode/DerivedData/Test_For_XCode10_3_OSX-hgoylqhnqqltefdmpqegbnxnssog/Build/Products/Release/Test For XCode10_3 OSX.app/Contents/Frameworks/libswiftDarwin.dylib: errSecInternalComponent


I have tried to create a new MacOS project, same issue.


However, I can still compile IOS projects.


So I suspect I have something to clear in my MacOS certificates, but would need advice to avoid creating more mess.

What should I change ? How to restore access to the keychain if needed ?


Thanks

Accepted Reply

Have you looked at the keychain via Keychain Access?


Might want to houseclean...delete expired/revoked certs, check which ones related to mac dev/dist are current, if any.


See if there is any mismatch via Account/Member Center, C,I&P.


Be sure to backup before making any further changes. Do you have a backup of the keychain you can restore?


I think, tho, this is now about iCloud and/or 2Fa.


I assume you are only working with one dev account and one user, you.


Once/if you get certs and keychain in order, I'd restart the computer and then run Xcode. Confirm your dev account in prefs, make a new mac app to test, confirm the mac is authorized as a test device in Organizer/Devices. Don't be in a hurry - the backend signing servers always need time to do their thing and communicate to Xcode.


Still no joy, use a sterile macOS user account and try there - if it works for mac apps ok, compare it's keychain to the original user's keychain contents.


Good luck.

Replies

It seems even worse.


For some reason, probably by mistake, I revoked the certificate

You have revoked your certificate, so it is no longer valid.

Certificate: Mac Development


I went to XCode preferences, trying to recreate the certificate, but then, when I click "+", I get:

The user name or passphrase you entered is not correct.


So, trying the solution proposed here:

h ttps://github.com/desktop/desktop/issues/3625

I tried to lock session keychain and unlock.

I could lock, but impossible to unlock: get the spinning ball without any action.


Really need help.

Have you looked at the keychain via Keychain Access?


Might want to houseclean...delete expired/revoked certs, check which ones related to mac dev/dist are current, if any.


See if there is any mismatch via Account/Member Center, C,I&P.


Be sure to backup before making any further changes. Do you have a backup of the keychain you can restore?


I think, tho, this is now about iCloud and/or 2Fa.


I assume you are only working with one dev account and one user, you.


Once/if you get certs and keychain in order, I'd restart the computer and then run Xcode. Confirm your dev account in prefs, make a new mac app to test, confirm the mac is authorized as a test device in Organizer/Devices. Don't be in a hurry - the backend signing servers always need time to do their thing and communicate to Xcode.


Still no joy, use a sterile macOS user account and try there - if it works for mac apps ok, compare it's keychain to the original user's keychain contents.


Good luck.