I have a iOS app that has "Framework A" as a subproject and includes it as a target dependency. "Framework A" has "Framework B" has a subproject and includes it as a target dependency. Finally "Framework B" has "Framework C" as a subproject and includes it as a target dependency.
This project builds fine and works perfectly in the Simulator but blows up immediately with the error dyld: Library not loaded: @rpath/Framework A.framework/Framework A
.
The problem is that the "Framework A.framework" file is not automatically copied into the app's executable. You can add a "Copy File" build phase to your app target and specify that "Framework A.framework" should be embedded into the executable but this solution doesn't scale. You are still missing "Framework B.framework" and "Framework C.framework".
For example, imagine you have a complex dependency structure like described in the question What is the correct process for linking static libraries that have common static libraries?. You would have to manually embed six frameworks into your executable and if the root framework added any more dependencies the project wouldn't build anymore. You'd have to remember to manually embed any new dependencies.
So does anyone know if there is a way for Xcode to automatically embed your target dependency frameworks (like it does with static libraries) or why Apple doesn't do this? Especially with iOS it seems absolutely pointless to have Xcode build frameworks to the build directory and then do absolutely nothing with them.