Custom Frameworks don't work with Swift 3

I have the following set up:


  • Framework C depends on Framework B
  • Framework B depends on Framework A
  • Framework A depends on nothing


I control all the frameworks but for organizational reasons it makes sense that they're split up. This setup worked perfectly fine with Swift 2.2 but in Swift 3 I get the following error whenever I try to add more than one framework to the project:


Apple Swift version 3.0 (swiftlang-800.0.43.6 clang-800.0.38)
Target: x86_64-apple-ios10.0
<unknown>:0: error: merge-module command failed with exit code 1 (use -v to see invocation)


If I add just Framework A as an embedded framework, it compiles and runs fine. If I try to add Framework A + B, I get the error.

It's not clear what you mean by "A + B". Also, it's not clear whether you "try to add" addtional frameworks targets to the project, or additional frameworks subprojects to the project, or additional frameworks references to the project.


Are all 3 frameworks embedded? In that case, the B target should link against A, the C target should link against B, and the app target should embed A, B and C.


The other, unrelated, possibility is that when you updated the project from Xcode 7 to 8, build settings got changed in such a way that the frameworks ended up with conflicting names. Look in the build settings for anything inappropriate in the bundle identifiers, module names, and product names.

Custom Frameworks don't work with Swift 3
 
 
Q