I have the following error:
Command /usr/bin/codesign failed with exit code 1
Here is what I already did for trying to fix this:
Here is how I solved the same problem. It may help someone.
I deleted the Development Provisionning Profile (that I was using) from the server, then created one with a slightly different name. I used it and it worked.
This issue happened for me when I had multiple targets in one project, and I changed the CFBundleExecutable
plist property to something other than the target's name.
So, for example, I had the following targets in one project:
SomeApp for OS X had its CFBundleExecutable
property set to just SomeApp
, which not only conflicted with the first target called SomeApp but was different from the target it was meant for. Changing SomeApp for OS X to SomeApp and then renaming the first target worked fine for me.
What worked for me was to realize that Xcode did not have access to the certificates. Please check that your certs are accessible by Xcode. Go to Keychain Access -> Certificates -> Open the Cert and double click on the private key -> Select Access Control
Most answers will tell you that you have a duplicate certificate. This is true for my case but the answers left out how to do it.
For me, my account expired and I have to get a new certificate and install it. Next, I looked at Keychain and removes the expired certificate but still got the error. What works for me is actually searching for "iPhone" in Keychain and removing all expired certificates. Apparently, some of it are not shown in System/Certificates or login/Certificates.
Hope this helps!
I recently had the same issue. Keychain Access was the culprit.
Steps: Go -> Utilities -> Keychain Access Keychain Access: Edit -> Change Password for Keychain "login"
Change the password. Close and reopen Xcode, Clean & build again.
If option - Change Password for Keychain "login" - is greyed out:
Make sure under Keychains selected -> login and the padlock icon is open. To open the padlock you need the keychain password. If you do not know the password, go to Step 2.
With padlock unlocked and still option is greyed out. As last resort: Keychain Access -> Preferences Preferences: "Reset My Default Keychains" Reset the login. However be careful as stored keychains will be removed and you may have re-login on other connected devices as well.
I went to Key Access, selected the private key, and added XCode to the list of apps that can access it. That worked for me