Getting this error command /usr/bin/codesign failed with exit code 1 with xcode 9.1?

大憨熊 提交于 2019-11-29 04:26:42

Try updating your keyChain password. For that try following

  • If you don't know your old password, the solution is to create a new login keychain.

  • If you know your old password, use that password to update your existing login keychain:

    1. Open the Keychain Access app, which is in the the Utilities folder of your Applications folder.
    2. From the list of keychains on the left side of the window, select "login."
    3. From the Edit menu in the menu bar, choose “Change Password for Keychain 'login.'”
    4. Enter the old password of your user account in the Current Password field.
    5. This is the password you were using before the password was reset.
    6. Enter the new password of your user account in the New Password field. This is the password you're now using to log in to your Mac. Enter the same password in the Verify field.

Click OK when done, then quit Keychain Access. Quit your Xcode, reopen the project and try building your project it should work.

I encountered this problem a few times over the past month and it was always right after I had imported some .png files into Xcode. I was able to recreate the error repeatedly if I imported a .png file that was exported from Illustrator using the "Save for Web" which did not including the resolution meta data that is read by Xcode. (screenshot attached)

But, if I exported the file using the "Export As" setting in Illustrator, set the resolution to 144px, and then imported it into Xcode, the error would disappear. (screenshot attached)

Just make sure to delete the images without the resolution listed and you will hopefully be good to go!

This started happening to me in Xcode 9, along with a host of other keychain-related problems (I'm on 9.3 and it just happened today). Sometimes the automatic code signing just spontaneously goes afoul for me and I start getting an errSecInternalComponent error along with the codesign failed with exit code 1.

What has consistently worked is to go into Xcode -> Preferences -> Accounts, go to Manage Certificates... and use the plus sign to add the certificates I need, even if it looks like there are perfectly good one's already present. I don't know why these certificates would be any different, but... they just work.

I changed my Mac's general login password and it worked.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!