Xcode 错误:命令 /usr/bin/codesign 失败,退出代码为 1

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7071691/
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-14 21:44:24  来源:igfitidea点击:

Xcode Error: Command /usr/bin/codesign failed with exit code 1

xcodeexit-codecodesign

提问by michaellindahl

I have no idea why I am getting this error. I believe that I have all the correct provisioning profiles and such. I did just move to a new computer but I did also bring over the private keychain developer key. I have my developer files synced with Dropbox so I didn't need to move over the Xcode project. Here is the error:

我不知道为什么会收到此错误。我相信我拥有所有正确的配置文件等。我刚刚搬到了一台新电脑,但我也带来了私人钥匙串开发人员密钥。我的开发人员文件已与 Dropbox 同步,因此我不需要移动 Xcode 项目。这是错误:

   CodeSign "/Users/michaellindahl/Library/Developer/Xcode/DerivedData/Fraction_Calculator-cgirhuuvywfnsyenisucsuauquoz/Build/Products/Debug-iphoneos/Fraction Calculator Pro.app"
    cd "/Users/michaellindahl/Dropbox/Xcode/lindahl studios/FractionCalculator"
    setenv CODESIGN_ALLOCATE /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
    setenv PATH "/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /usr/bin/codesign --force --sign "iPhone Developer: Michael Lindahl (MXXX0X0XXB)" "--resource-rules=/Users/michaellindahl/Library/Developer/Xcode/DerivedData/Fraction_Calculator-cgirhuuvywfnsyenisucsuauquoz/Build/Products/Debug-iphoneos/Fraction Calculator Pro.app/ResourceRules.plist" --entitlements "/Users/michaellindahl/Library/Developer/Xcode/DerivedData/Fraction_Calculator-cgirhuuvywfnsyenisucsuauquoz/Build/Intermediates/Fraction Calculator.build/Debug-iphoneos/Fraction Calculator Pro.build/Fraction Calculator Pro.xcent" "/Users/michaellindahl/Library/Developer/Xcode/DerivedData/Fraction_Calculator-cgirhuuvywfnsyenisucsuauquoz/Build/Products/Debug-iphoneos/Fraction Calculator Pro.app" 

CSSM_SignData returned: 8001094A
    /Users/username/Library/Developer/Xcode/DerivedData/Fraction_Calculator-cgirhuuvywfnsyenisucsuauquoz/Build/Products/Debug-iphoneos/Fraction Calculator Pro.app: unknown error -2070=fffffffffffff7ea
    Command /usr/bin/codesign failed with exit code 1

Thanks for your insight.

感谢您的洞察力。

采纳答案by KevinDTimm

You've almost certainly got corrupted certs :

您几乎可以肯定已经损坏了证书:

Revoke old certs, generate new ones, new provisioning profile, the works, magic happens again

撤销旧证书,生成新证书,新配置文件,工作,魔术再次发生

回答by plm

This seems senseless, but I simply locked and then unlocked the login keychain and the problem went away. On reflection, the problem occurred after I had added a new certificate to the keychain. Maybe the addition of this additional certificate (unrelated to the current project) caused the problem.

这似乎毫无意义,但我只是锁定然后解锁登录钥匙串,问题就消失了。经过反思,问题发生在我向钥匙串添加新证书之后。也许添加这个附加证书(与当前项目无关)导致了问题。

回答by csano

Try going through all of the steps in the Managing Devices and Digital Identitiesdocument. This should help you verify that your machine is correctly set up.

尝试完成管理设备和数字身份文档中的所有步骤。这应该可以帮助您验证您的机器是否正确设置。