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

4

9

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"
Concinnate answered 29/9, 2014 at 10:28 Comment(0)
C
15

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.

Concinnate answered 29/9, 2014 at 10:28 Comment(2)
That post was from before Beta 2 (think it was beta 2) which added support for frameworks. I have had this error intermittently and have had to restart XCode and do a clean build to get around it. In short, this has been an intermittent problem for me.Hunkers
And, still in 6.1 also.Unveiling
A
5

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".

Aretino answered 30/10, 2014 at 0:32 Comment(0)
E
0

Try and remove the library from build settings.

Open project in xcode -> Runner -> Build settings -> GO to Other Linker Flags -> Click on Multiple values, and Find and remove the library.

enter image description here

Erny answered 3/5 at 9:46 Comment(0)
W
0

I fixed it by setting "Build Settings" -> "Build Options" -> "Build Library for Distribution" flag to NO for the target of this module.

https://i.sstatic.net/f9vNcD6t.png

Wayward answered 18/7 at 9:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.