umbrella header for module 'myFramework' does not include header 'otherFramework.h'

hibento picture hibento · Oct 3, 2015 · Viewed 35.9k times · Source

My Swift / iOS9 framework 'viewer_protocol' uses another and external Objective-C framework (CocoaAsyncSocket). I'm using Carthage to build CocoaAsyncSocket. So far everything works fine: In have an example App inside my framework Xcode Project using my framework without any problems.

Now I want to use my Framework in a different Xcode Project - although using Carthage. I include only my Framework as a dependency and Carthage automatically resolves the dependencies to CocoaAsyncSocket. I embedded both frameworks into this new Xcode Project and build my App: Everything works fine here - except one warning I can't rid off:

/Users/John/Repositories/my_project/<module-includes>:1:1: 
Umbrella header for module 'my_project' does not include header 'GCDAsyncSocket.h'

This is my framework header:

#import <UIKit/UIKit.h>

//! Project version number for my_project.
FOUNDATION_EXPORT double my_projectVersionNumber;

//! Project version string for my_project.
FOUNDATION_EXPORT const unsigned char my_projectVersionString[];

// In this header, you should import all the public headers of your framework     
using statements like #import <my_project/PublicHeader.h>
#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

As you can see CocoaAsyncSocket.h is imported. Furthermore inside my framework the CocoaAsyncSocket.h file is included:

my framework's folder

What I am missing here? I'm using several others external frameworks inside my framework, there're no warnings for them - all of these external frameworks are written in Swift - CocoaAsyncSocket is pure Objective-C.

This is my frameworks module.modulemap:

 framework module my_project {
   umbrella header "my_project.h"

   export *
   module * { export * }
 }

 module viewer_protocol.Swift {
     header "my_project-Swift.h"
 }

Update

I found a solution: Changing the import statement in my framework header from

#import <CocoaAsyncSocket/CocoaAsyncSocket.h>

to

#import "CocoaAsyncSocket/CocoaAsyncSocket.h"

Now Xcode finds the header file and the warning disappears.

Answer

AyJay picture AyJay · Aug 3, 2016

I recently ran into same issue. Apparently I had header file set as public in target membership, but it was not exposed in umbrella header. Fixed issue by making header file with project access instead of public.