无法在 Xcode CSSMERR_TP_NOT_TRUSTED 中签署应用程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/6883167/
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
Cannot sign app in Xcode CSSMERR_TP_NOT_TRUSTED
提问by mrwooster
I have downloaded and installed the WWDR certificate. I have tried setting it to Always Trust andsystem defaults.
我已经下载并安装了 WWDR 证书。我尝试将其设置为始终信任和系统默认值。
When I try to archive my app I get the CSSMERR_TP_NOT_TRUSTED error.
当我尝试归档我的应用程序时,我收到 CSSMERR_TP_NOT_TRUSTED 错误。
If I try signing manually I get the same:
如果我尝试手动签名,我会得到相同的结果:
/usr/bin/codesign --force --sign "3rd Party Mac Developer Application: XX XXX-XXX" /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/XXX/InstallationBuildProductsLocation/Users/XXX/Applications/XXX.app
/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/xxx/InstallationBuildProductsLocation/Users/xxx/Applications/xxx.app: replacing invalid existing signature /Users/xxx/Library/Developer/Xcode/DerivedData/xxx-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/xxx/InstallationBuildProductsLocation/Users/xxx/Applications/xxx.app: CSSMERR_TP_NOT_TRUSTED
/usr/bin/codesign --force --sign "3rd Party Mac Developer Application: XX XXX-XXX" /Users/XXX/Library/Developer/Xcode/DerivedData/XXX-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/XXX/InstallationBuildProductsLocation/Users/XXX /应用程序/XXX.app
/Users/xxx/Library/Developer/Xcode/DerivedData/xxx-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/xxx/InstallationBuildProductsLocation/Users/xxx/Applications/xxx.app:替换无效的现有签名/Users/xxx/Library/Developer/Xcode/DerivedData/ xxx-fivqootinaolitdbpxccqykoaoqs/ArchiveIntermediates/xxx/InstallationBuildProductsLocation/Users/xxx/Applications/xxx.app: CSSMERR_TP_NOT_TRUSTED
BUT
但
If I use
如果我使用
sudo /usr/bin/codesign --force --sign
须藤/usr/bin/codesign --force --sign
Then it works....
然后它工作......
The key is installed in keychain access in the 'login' chain.
密钥安装在“登录”链中的钥匙串访问中。
回答by Bobjt
Obishawn used one of the suggestions provided by Apple in the following steps published to troubleshoot this error - How do I resolve the CodeSign error: CSSMERR_TP_NOT_TRUSTED?. For others experiencing this build error -
Obishawn 在发布的以下步骤中使用了 Apple 提供的建议之一来解决此错误 -如何解决 CodeSign 错误:CSSMERR_TP_NOT_TRUSTED?. 对于遇到此构建错误的其他人 -
CSSMERR_TP_NOT_TRUSTED
CSSMERR_TP_NOT_TRUSTED
the above guide covers a more broad range of potential causes. The error can also occur at Xcode Archive > Share, Validate, or Submit time, and the above steps to resolve it are the same.
上述指南涵盖了更广泛的潜在原因。Xcode Archive > Share、Validate 或 Submit 时间也可能出现该错误,上述解决步骤相同。
回答by jeromed
My two cents on that problem : I had to fight with it for some hours. Here are what I had to fix to have codesign do its job :
我在这个问题上的两分钱:我不得不与它斗争几个小时。以下是我必须解决的问题才能让 codesign 完成其工作:
- Ensure that certificates are not duplicatedbetween the login and the system keychain
- Ensure no old / expired / revoked versions of the certificates existin any keychain
- Ensure all certificates have "system default" trust policy. If one is set to "always trust", then codesign will fail.
- 确保登录名和系统钥匙串之间的证书没有重复
- 确保任何钥匙串中都不存在旧的/过期的/撤销的证书版本
- 确保所有证书都具有“系统默认”信任策略。如果设置为“始终信任”,则协同设计将失败。
This last point was found on a machine that was migrated to Xcode 8.2 recently. It might be a new behavior of Xcode 8.
最后一点是在最近迁移到 Xcode 8.2 的机器上发现的。这可能是 Xcode 8 的新行为。
回答by Obishawn
Ok, I finally figured mine out. I had the WWDR certificate in my login keychain and my System keychain. I deleted both and reimported a fresh one from Apple and everything works now. I can codesign without using sudo and MonoDevelop can fully compile for distribution and upload to my devices.
好吧,我终于想通了我的。我的登录钥匙串和系统钥匙串中有 WWDR 证书。我删除了两个并从 Apple 重新导入了一个新的,现在一切正常。我可以在不使用 sudo 的情况下进行协同设计,MonoDevelop 可以完全编译以进行分发并上传到我的设备。