Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"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"
like image 287
Vatsal Manot Avatar asked Sep 29 '14 10:09

Vatsal Manot


2 Answers

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:

  • Go to the Product menu.
  • Click on Build For.
  • Select Testing.

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

like image 89
Vatsal Manot Avatar answered Sep 27 '22 23:09

Vatsal Manot


I was able to fix this issue. If you are importing a module that links any Objective-C frameworks, you need to import those Objective-C frameworks in your module too. That shouldn't add to your bundle size if you are not using a static library.

I imported all of the frameworks needed for Parse into one module "Module A". In order to import "Module A" into "Module B", I had to add all of the required Parse frameworks and "Module A" to my Linked Libraries for "Module B".

like image 37
r3c0d3 Avatar answered Sep 27 '22 22:09

r3c0d3