Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 873
hibento Avatar asked Oct 03 '15 14:10

hibento


4 Answers

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.

like image 104
AyJay Avatar answered Oct 31 '22 18:10

AyJay


I had the same issue today

Umbrella header for module 'HockeySDK' does not include header 'BITHockeyBaseViewController.h'

and the solution was

1.build and run project and go-to Report Navigator

2.look at the warning, click to expand details

it will so you the file name where you need to make change as you can seen in below screen shot

enter image description here

So i just updated my import statement in AppDelegate.m file

New

#import "HockeySDK/HockeySDK.h"

Old

#import <HockeySDK/HockeySDK.h>

and issue gone..

hope this will help someone. who are coming here for solution.

like image 25
swiftBoy Avatar answered Oct 31 '22 18:10

swiftBoy


I had the same issue. Seemed to be related to old build files.

The standard Xcode problem fixer worked for me:

  1. Clean project (Product > Clean Build Folder)
  2. Deleted derived data
  3. Restart Xcode
like image 26
Senseful Avatar answered Oct 31 '22 17:10

Senseful


For me the solution was as follows:

1) Each Objective C framework has 1 header file that contains all the:

#import ...
#import ...
#import ...

2) Make sure that this file imports the missing header.

3) Build the project again, it should remove the warning.

like image 16
Oded Regev Avatar answered Oct 31 '22 17:10

Oded Regev