macOS:Homebrdy dylib公式全部出现代码签名错误 [英] macOS: Homebrew dylib formula all hit code-sign errors
本文介绍了macOS:Homebrdy dylib公式全部出现代码签名错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在macOS上,我曾经使用通过Homebrew安装的有问题的动态库。
On macOS, I used to work with dynamic libraries installed via Homebrew with issues.
但是使用我的最新设置:
But with my latest setup:
- Mojave 10.14.6
- Xcode 11.2.1
我开始遇到以前可以使用的库(例如protobuf)的代码签名问题。
I start getting code sign problems with the libs that used to work, such as protobuf.
下面是运行成功构建的项目时的控制台输出:
Below is the console output when running a successfully built project:
dyld: Library not loaded: /usr/local/opt/protobuf/lib/libprotobuf.22.dylib
Referenced from: /path/to/myproj/_build/Debug/mam-host
Reason: no suitable image found. Did find:
/usr/local/opt/protobuf/lib/libprotobuf.22.dylib: code signature in (/usr/local/opt/protobuf/lib/libprotobuf.22.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
/usr/local/Cellar/protobuf/3.11.1/lib/libprotobuf.22.dylib: code signature in (/usr/local/Cellar/protobuf/3.11.1/lib/libprotobuf.22.dylib) not valid for use in process using Library Validation: mapped file has no cdhash, completely unsigned? Code has to be at least ad-hoc signed.
Program ended with exit code: 9
我该怎么办?
我应该
codesign -s "Mac Developer: me" /usr/local/opt/protobuf/lib/libprotobuf.22.dylib
我必须从源代码构建?
PS在上面运行codesign命令后,我得到了完全相同的错误。
P.S. After running codesign command above I got the exact same error.
推荐答案
最后解决了它。
您有两个选项:
- 选项1 禁用对库的代码签名检查 :
项目设置>签名和能力>强化运行时>运行时异常> Diable库验证
- 选项2:使用您的代码签名身份进行代码签名库,例如
Apple Development:您的名字(10位字符)
- 删除公共签名:
codesign --remove-signature /path/to/theirlib.dylib
- 使用项目签名签名:
codesign -s Apple Development:您的名字(10个字符,ID) /path/to/theirlib.dylib
- Option 1 Disable checking on code-signing for libs:
Project Settings > Signing & Capabilities > Hardened Runtime > Runtime Exceptions > Diable Library Validation
- Option 2: Code-sign libs using your code-signing identity, e.g.
Apple Development: Your Name (10-char-ID)
- Remove public signature:
codesign --remove-signature /path/to/theirlib.dylib
- Sign with project signature:
codesign -s "Apple Development: Your Name (10-char-ID)" /path/to/theirlib.dylib
这篇关于macOS:Homebrdy dylib公式全部出现代码签名错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
- Remove public signature:
- 删除公共签名:
查看全文