Xcode 7 Doesn't See My Framework

Updated an app to iOS 9 / Swift 2 / watchOS 2 and since then, Xcode claims it can't find my embedded framework when building the watchOS extension. It has no issues finding it for my iOS app and the build settings look ok - the framework is showing as a dependency... but yeah, no dice. Tried cleaning and nuking Derived Data.


Any ideas?


Answered by ehsan in 7254022

Check the Target Platform of your framework and watchkit extensiosn in their Build Settings.

It seems currently Xcode 7 only lets you choose either iOS or watchOS, but since your framework is shared between platforms you need to manually put all 4 of: watchsimulator, watchos, iphonesimulator, iphoneos


In my case, after fixing the above, I also needed to add armv7k and i386 to Valid Architectures.


Then I finally got to see all the new WatchKit compile errors 🙂

Accepted Answer

Check the Target Platform of your framework and watchkit extensiosn in their Build Settings.

It seems currently Xcode 7 only lets you choose either iOS or watchOS, but since your framework is shared between platforms you need to manually put all 4 of: watchsimulator, watchos, iphonesimulator, iphoneos


In my case, after fixing the above, I also needed to add armv7k and i386 to Valid Architectures.


Then I finally got to see all the new WatchKit compile errors 🙂

In the labs today, they implied that you really want a separate target for each framework, though they can contain the same files.

Could you elaborate on this? Does this mean having each framework only link with a single target?

Xcode 7 Doesn't See My Framework
 
 
Q