Xcode 11,命令 CodeSign 失败,退出代码非零
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/58195914/
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
Xcode 11, Command CodeSign failed with a nonzero exit code
提问by HymanKalish
Ever since updating (against my will) to Xcode 11, I'm getting this error when I try to build my project:
自从更新(违背我的意愿)到 Xcode 11 后,当我尝试构建我的项目时出现此错误:
CodeSign /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app (in target 'pplight-ofx-098' from project 'pplight-ofx-098')
cd /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098
export CODESIGN_ALLOCATE=/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate
Signing Identity: "-"
/usr/bin/codesign --force --sign - --entitlements /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/build/pplight-ofx-098.build/Debug/pplight-ofx-098.build/pplight-ofx-098Debug.app.xcent --timestamp=none /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app
/Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app: code object is not signed at all
In subcomponent: /Volumes/HDD/OpenFrameworks/of_v0.9.8_osx_release/apps/plus-pool-light/pplight-ofx-098/bin/pplight-ofx-098Debug.app/Contents/Frameworks/GLUT.framework
Command CodeSign failed with a nonzero exit code
I've tried cleaning my project, resetting my login keychain, and restarting my computer, but I still get this error... what to do?
我已经尝试清理我的项目,重置我的登录钥匙串,并重新启动我的电脑,但我仍然收到这个错误......怎么办?
I am building an OSX App using OpenFrameworks, not an iOS App.When I build it in Xcode 10.3 works fine with no errors.
我正在使用 OpenFrameworks 构建 OSX 应用程序,而不是 iOS 应用程序。当我在 Xcode 10.3 中构建它时,它工作正常,没有错误。
The parts of this question that are unique is that this is for Xcode 11, not 10, and none of the answers for that other question worked for me!
这个问题的独特之处在于,这是针对 Xcode 11,而不是 10,并且其他问题的答案都不适合我!
回答by SleepySquash
I've resolved the same exact problem by:
我已经通过以下方式解决了同样的问题:
- Add --deep to the "Other Code Signing Flags" in the "Build Settings".
- In the "Signing & Capabilities" of your target click on "+ Capability" in the top left corner and choose "Hardened Runtime".
- Then turn on "Disable Library Validation" in the list.
- 将 --deep 添加到“构建设置”中的“其他代码签名标志”。
- 在目标的“签名和能力”中,单击左上角的“+ 能力”并选择“强化运行时”。
- 然后打开列表中的“禁用库验证”。
I don't really know if there's any drawbacks by using this capability, however my application compiles and works fine both on macOS and iOS.
我真的不知道使用此功能是否有任何缺点,但是我的应用程序可以在 macOS 和 iOS 上编译并正常运行。
回答by NathanNovak
I got the same error after I upgraded to XCode-11 this morning. Builds in the simulator but not on device.
今天早上升级到 XCode-11 后,我遇到了同样的错误。在模拟器中构建,但不在设备上构建。
This thread helped fix the issue which I summarized below.
这个线程帮助解决了我在下面总结的问题。
https://stackoverflow.com/a/52628909/9286768
https://stackoverflow.com/a/52628909/9286768
- Open keychain access.
- Lock the 'login' keychain. (right clicking on "login" in the upper left panel)
- Unlock it, enter your PC account password.
- Clean Project in the product menu.
- Build it Again.
- 打开钥匙串访问。
- 锁定“登录”钥匙串。(右键单击左上面板中的“登录”)
- 解锁它,输入您的PC帐户密码。
- 产品菜单中的 Clean Project。
- 再建一次。
回答by Akindele Oluwakamiye
You can get this error if you have added a folder to your project as a 'folder reference' (the project will have a blue folder logo in Xcode)
如果您已将文件夹作为“文件夹引用”添加到项目中,则会出现此错误(该项目在 Xcode 中将有一个蓝色文件夹徽标)
- Remove the folder (Trash)
- Add folder and select 'Create Groups' instead of 'Folder Reference' at the dialog Add Folder Dialog
- 删除文件夹(垃圾箱)
- 添加文件夹并在对话框添加文件夹对话框中选择“创建组”而不是“文件夹引用”
回答by MrPickles2009
I fixed this by adding --deep
to Other Code Signing Flagsin the Build Settings > Signing
我通过在 Build Settings > Signing 中添加--deep
到Other Code Signing Flags来解决这个问题