签名嵌入式框架在Xcode 11.2.1中不起作用 [英] Signing embedded framework not working in Xcode 11.2.1
问题描述
我有一个小型的概念验证应用程序,我试图在其中将框架(Alamofire)嵌入(并签名)在我的框架(AequumPOCFramework.framework)中,但是,当我尝试将其部署到设备时,一直给我错误
I have a small proof-of-concept app, where I am trying to embed (and sign) a framework (Alamofire) inside of my framework (AequumPOCFramework.framework), however, when I try to deploy to my device, it keeps giving me the error
....不适用于在使用库验证的过程中使用:映射文件没有cdhash,完全未签名吗?代码必须至少是临时签名.
....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.
如果我只是尝试部署自己的框架而没有嵌入Alamofire,则一切正常.
If I just try to deploy my own framework, without having Alamofire embedded in it, everything works fine.
部署到我的iPhone时的完整错误是:
The complete error at deploy to my iphone is:
模型:库未加载:@ rpath/Alamofire.framework/Alamofire 引用自:/private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Frameworks/AequumPOCFramework.framework/AequumPOCFramework 原因:找不到合适的图像.确实找到了: /private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Framework/AequumPOCFramework.framework/Frameworks/Alamofire.framework/Alamofire:代码签名位于(/private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Frameworks/AequumPOCFramework.framework/Frameworks/Alamofire.framework/Alamofire)在使用库验证的过程中无效:映射文件没有cdhash,完全未签名?代码必须至少是临时签名.
dyld: Library not loaded: @rpath/Alamofire.framework/Alamofire Referenced from: /private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Frameworks/AequumPOCFramework.framework/AequumPOCFramework Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Frameworks/AequumPOCFramework.framework/Frameworks/Alamofire.framework/Alamofire: code signature in (/private/var/containers/Bundle/Application/EDB697EB-EA15-4301-B4B6-A8FE1F0212BE/PocIOS.app/Frameworks/AequumPOCFramework.framework/Frameworks/Alamofire.framework/Alamofire) 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.
我在做什么错了?
推荐答案
Nested frameworks are not supported on iOS (see technotes). The only legit solution at the moment is to link "embedded" frameworks directly to a hosting app.
* XCFramework主要是特定于平台的二进制文件的集合,不幸的是与嵌入框架无关.
* XCFramework is mainly an aggregation of platform specific binaries' and has nothing to do with embedding frameworks unfortunately.
这篇关于签名嵌入式框架在Xcode 11.2.1中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!