iosdynamicswiftmoduleframeworks

"error: underlying Objective-C module <module> not found"


With the release of iOS 8 and Xcode 6, it is now possible to build dynamic iOS frameworks. It seems that Apple still hasn't documented this topic as of yet, leaving developers to fend for themselves against the deadly, cryptic errors of Xcode, one particularly nasty:

"error: underlying Objective-C module <module> not found"

Solution

  • Apple does not promote distribution of iOS frameworks as of Xcode 6 (referring to this SO post):

    Xcode 6 does not support building distributable Swift frameworks at this time and that Apple likely won't build this functionality into Xcode until its advantageous for them to do so.

    However, it is not impossible to build one:

    And as always, trashing Xcode's DerivedData folder (rm -rf ~/Library/Developer/Xcode/DerivedData) usually solves any trivial problems that may arise.