umbrella header not found

Hi all,


I'm building a framework and I decided to include some new libraries using Swift. My original framework was built in Objective-C after adding the new code everything seemed to be fine no erros at all but once I try to build the project I got the error message: "umbrella header project.h not found" uthis under the unextended-module.modulemap file the file looks like



framework module Project {

umbrella header "Project.h"

export *

module * { export * }

}

module Project.__Swift {

exclude header "Project-Swift.h"

}


Any help will be highly appreciated it as I have try differente things in the "Build Settings"


Before this I was using a bridging file but apparently bridging files are not allowed on Frameworks.

Is someone gonna help? 😝

You might want to look at this stackoverflow question...

http://stackoverflow.com/questions/30355133/swift-framework-umbrella-header-h-not-found

I just figured this out recently. Here is a repost of an answer I provided on SO. You can read below and search for more solutions under this title (Swift to Objective-C header not created in Xcode 6)


This answer addresses the use-case where you may already have some Objective-C code that calls Swift classes and then you start receiving this error.

How To Fix Issue


The following steps ultimately resolved all of the issues for me. I read above someone mentioning the "chicken and the egg" and it is exactly that concept which led me to this procedure. This explicit process shows that one has to remove any Objective-C code referencing Swift classes until after the header is generated.

  1. Comment out the #import "ProductModuleName-Swift.h" statement in your Objective-C implementation file
  2. Comment out any references in the Objective-C implementation file to Swift Classes
  3. Clean & Build
  4. Resolve all errors/warnings
  5. Remove the comment on the #import "ProductModuleName-Swift.h" statement
  6. Clean & build (successfully or fix any remaining errors, verify that you are not referencing any Swift classes in Objective-C at this point. If so temporarily comment these out)
  7. Verify that "ProductModuleName-Swift.h" is generated by Cmd-Clicking on the class name of the #import "ProductModuleName-Swift.h" statement
  8. Remove the comment on the code referencing Swift classes in the Objective-C implementation file.
  9. Clean & Build as normal (the "ProductModuleName-Swift.h" should be generated and your Objective-C code referencing Swift Classes can be used as normal)

Nota Bene: The answers about changing spaces to underscores and the Defines Module to YES as given above still applies when performing this process, as do the rules specified in the Apple Documentation.

Bridging Header Path

In one error, the file ProductModuleName-Bridging-Header.h was not being found during the build process. This fact generated an error

< unknown>:0: error: bridging header '/Users/Shared/Working/abc/abc-Bridging-Header.h' does not exist

Closer inspection of the error indicated that the file would never exist at the location described because it was actually located at (a wrong path)

'/Users/Shared/Working/abc/abc/abc-Bridging-Header.h'. a quick search of the target/projects build settings to make the correction manually and the abc-Swift.h file was again auto generated.

I fixed this by deleting my Project.h using Xcode (with move to trash) and then recreating it.

umbrella header not found
 
 
Q