Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Signing embedded framework not working in Xcode 11.2.1

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

....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.

If I just try to deploy my own framework, without having Alamofire embedded in it, everything works fine.

The complete error at deploy to my iphone is:

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.

What am I doing wrong?

enter image description here

enter image description here

enter image description here

enter image description here

like image 339
geekyaleks Avatar asked Nov 12 '19 16:11

geekyaleks


Video Answer


2 Answers

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 is mainly an aggregation of platform specific binaries' and has nothing to do with embedding frameworks unfortunately.

like image 54
berec Avatar answered Sep 21 '22 21:09

berec


You gotta embed Alamofire to your project, too.

For example, you are using Carthage and the Cartfile of your framework has Alamofire library. You gotta use the same Carfile for your main app, too. Also, you gotta perform other Carthage actions(linking library, adding run script) for the main app.

like image 22
Yusuf Avatar answered Sep 18 '22 21:09

Yusuf