Mac开发-codesign_allocate: can't allocate code signature data

参考链接 https://github.com/xamarin/xamarin-macios/issues/5243

网上说查看 /usr/bin/codesign_allocate 并替换,但这个报错本来是正常的,突然就出现了。很气怪,有时候就改了一部分代码就出现。

后面根据上面链接,发现是install_name_tool的问题,这个指令用户我们设置动态库的引用问题,但同时也会导致codesign_allocate: can't allocate code signature data

例如如下:

error: install_name_tool: can't open file: /Users/gensee/Library/Developer/Xcode/DerivedData/Webcast-fdypojugksmojmbaqvqtwgrphsmc/Build/Products/Debug/Webcast.app/Contents/MacOS/libRtRoutineOSX.dylib (No such file or directory)
finish install_name_tool target /Users/gensee/Library/Developer/Xcode/DerivedData/Webcast-fdypojugksmojmbaqvqtwgrphsmc/Build/Products/Debug/Webcast.app/Contents/MacOS/Webcast
Command /bin/sh emitted errors but did not return a nonzero exit code to indicate failure
codesign_allocate: can't allocate code signature data for:  (for architecture x86_64) because larger updated load commands do not fit (the program must be relinked using a larger -headerpad value)

和类似下面的

atal error: codesign_allocate: can't allocate code signature data for: 
            /...../X.app/Contents/Frameworks/libtiff.5.dylib
 (for architecture x86_64) 

because larger updated load commands do not fit (the program must be relinked using a larger -headerpad value)

                /..../Products/Debug/X.app: 

the codesign_allocate helper tool cannot be found or used
In subcomponent: /..../Products/Debug/X.app/Contents/Frameworks/libtiff.5.dylib

这里我的问题是:
去掉了重复和不必要的install_name_tool,或者将其放在脚本中执行,这样会在code sign之后,偶尔出现的codesign_allocate彻底解决了,不会再出现。如果你也遇到,请考虑是否install_name_tool重复操作过多的问题,避免不必要的install_name_tool

如果你还是出现该问题,可以在other linker flags中添加 -headerpad_max_install_names
在这里插入图片描述
https://blog.csdn.net/shengpeng3344/article/details/103920398

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值