获取此错误命令 /usr/bin/codedesign failed with exit code 1 with xcode 9.1?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/47409062/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 10:26:50  来源:igfitidea点击:

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

iosxcodeios11xcode9.1

提问by xeb

I am getting this error

我收到此错误

/Users/macbook/Library/Developer/Xcode/DerivedData/xxxxx-egjyfcyhdfcgftavbtoudbcgthja/Build/Products/Debug-iphoneos/xxxx.app: unknown error -1=ffffffffffffffff

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

with xcode 9.1/ios11.1 while building the application, earlier i was able to run my application smoothly. Any idea what could be the issue. I have already tried following steps:

在构建应用程序时使用 xcode 9.1/ios11.1,早些时候我能够顺利运行我的应用程序。知道可能是什么问题。我已经尝试过以下步骤:

Deleting all the Derived Data.

删除所有派生数据。

update all provisioning profile and certificates.

更新所有配置文件和证书。

But still no luck.

但仍然没有运气。

回答by Kadian

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.
  • 如果您不知道旧密码,解决方案是创建一个新的登录钥匙串。

  • 如果您知道旧密码,请使用该密码更新您现有的登录钥匙串:

    1. 打开钥匙串访问应用程序,它位于应用程序文件夹的实用程序文件夹中。
    2. 从窗口左侧的钥匙串列表中,选择“登录”。
    3. 从菜单栏中的“编辑”菜单中,选择“更改钥匙串‘登录’的密码。”
    4. 在当前密码字段中输入您的用户帐户的旧密码。
    5. 这是您在重置密码之前使用的密码。
    6. 在新密码字段中输入您的用户帐户的新密码。这是您现在用于登录 Mac 的密码。在验证字段中输入相同的密码。

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

完成后单击“确定”,然后退出“钥匙串访问”。退出你的 Xcode,重新打开项目并尝试构建你的项目,它应该可以工作。

回答by ojbravo

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)

在过去的一个月里,我遇到了几次这个问题,并且在我将一些 .png 文件导入 Xcode 后总是正确的。如果我使用“Save for Web”导入从 Illustrator 导出的 .png 文件,该文件不包括 Xcode 读取的分辨率元数据,则我能够反复重新创建错误。(附截图)

enter image description here

在此处输入图片说明

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) enter image description here

但是,如果我使用 Illustrator 中的“导出为”设置导出文件,将分辨率设置为 144px,然后将其导入 Xcode,错误就会消失。(附截图) 在此处输入图片说明

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

只需确保删除未列出分辨率的图像,您就会顺利进行!

回答by Badam Baplan

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 errSecInternalComponenterror along with the codesign failed with exit code 1.

这在 Xcode 9 中开始发生在我身上,以及许多其他与钥匙串相关的问题(我在 9.3 上,它刚刚发生在今天)。有时,自动代码签名只是自发地去触犯了我,我开始得到一个errSecInternalComponent与一起错误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.

一直有效的是进入Xcode -> Preferences -> Accounts,转到Manage Certificates...并使用加号添加我需要的证书,即使看起来已经存在非常好的证书。我不知道为什么这些证书会有所不同,但是……它们可以正常工作。

回答by Hamoon Jamshidi Meydandar

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

我更改了 Mac 的通用登录密码,并且成功了。