Linking objc dynamic framework with another objc dynamic framework makes swift unit test target fail

I am building a dynamic framework in objective c that I have been unit testing with a Swift unit test target. This has worked fine until now.

I now have a need to link the framework that I am building with another obj-c dynamic framework. This also works fine and I can access the external framework from within my framework just fine.

However as soon as I link my dynamic framework with the external framework, my swift unit test target fails, being unable to find the header files in my own framework.

Anyone has any experience with this?


After some more searching I managed to find the answer to this question in this issue on Carthage:

A dynamic framework target does not have the "Embed Frameworks" build step since this is the responsibility of the host app, to embed any dependencies of the framework. This means my framework target can only link an external dynamic framework, but not embed it. This works fine for building the framework target. But when running my unit test target and the tests start to exercise my framework code the external dynamic framework is missing.

The solution, for me, was to add a Copy Files build step to my unit test target with the destination set to "Frameworks" and then drag the external dynamic framework here. This ensures the external dynamic framework is present in the test bundle and my unit test target works again.


 ? Getting Name of ObjC Enum in Swift 3?
 ? How to generate dynamic columns in JSF Datatable?
 ? NPE Argument Error: Parameter value is null (JSF) only when <h:head> is in page
 ? what are the minimal JSF jars needed to deploy a JSF app with Tomcat
 ? Printing a dynamic 2D array in C
 ? Dynamic printing array
 ? Using angular2. Dynamic event handling in real time
 ? Using angular2. Dynamic event handling in real time
 ? Using angular2. Dynamic event handling in real time
 ? Angular2 use of onmouseup event overwrites native behavior