Command /usr/bin/codesign failed with exit code 1

后端 未结 30 3443
执笔经年
执笔经年 2020-11-27 14:17

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:

相关标签:
30条回答
  • 2020-11-27 14:58

    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.

    0 讨论(0)
  • 2020-11-27 14:58

    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
    • SomeApp WatchKit Extension
    • SomeApp WatchKit App
    • SomeApp Today Widget
    • SomeApp for OS X (this is the target where the codesign error happens)

    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.

    0 讨论(0)
  • 2020-11-27 14:59

    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

    0 讨论(0)
  • 2020-11-27 15:00

    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!

    0 讨论(0)
  • 2020-11-27 15:00

    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:

    1. 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.

    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.

    0 讨论(0)
  • 2020-11-27 15:00

    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

    0 讨论(0)
提交回复
热议问题