Swift Framework: Umbrella Header '[...].H' Not Found

Swift Framework: Umbrella header '[...].h' not found

This will happen, when the Always Search User Paths setting is enabled for the Framework target.

Setting it to No will resolve that error.

IMHO this is a bug in the Swift Compiler and I have filed a radar with Apple.

See rdar://21038443

Umbrella Header Not Found When Changing Target Name or Product Name of Framework

It turns out the "umbrella header" is no other than the 'main' header for the framework that is created automatically by Xcode when you first create the project or framework target, and it must have the same name as the target (as explained, for example, here).

As to why both target and product must me named the same, I can only guess it has to do with keeping linking not too complicated (Apps are not 'linked against', so I guess there is no damage in the product name being anything you want).

I was trying to get away with a Single Header to Rule Them All (platforms), using TargetConditionals.h etc. to import either Cocoa.h or UIKit.h, which is impossible, because Xcode won't let you use the same name for both targets, and those have to match the name of their headers!

So, I settled for:

  • <MyFramework/MyFramework.h>: Classic. Accept No Substitutes. Exclusive for iOS, and

  • <MyFrameworkMac/MyFrameworkMac.h>: Now Available on the Mac too! - From the People Who Brought You MyFramework

Adding XCFramework to framework project gives error: Include of non-modular header inside framework module

The folks at ACRCloud got this working. Here's what I had to do:

  1. In Xcode select File > New > Project > iOS > Framework
  2. Set Language to Swift and create it
  3. Drag and drop the ACRCloudSDK.xcframework into the project
  4. In Finder, open the xcframework > ios-arm64_armv7 > Headers and drag and drop those two files into your project alongside the xcframework
  5. In the MyFramework.h file, import those two header files
#import "ACRCloudConfig.h"
#import "ACRCloudRecognition.h"

  1. In your framework target's Build Phases > Link Binary With Libraries, make sure ACRCloudSDK.xcframework is Required
  2. Expand the Headers section in Build Phases and move the header files from Project to Public

You should now be able to build the framework without error and use ACRCloudRecognition without issue.

no umbrella header found for target, module map will not be generated

Add a CKCountdownButton.h in framework fixed this issue.

I think the umbrella header means the header file with same name like Framework

Error: Could not build Objective-C module 'Firebase'

There is only one way to solve this issue.

  1. Quit Xcode.
  2. Delete project's temp files located at ~/Library/Developer/Xcode/DerivedData
  3. Delete ProjectName.xcworkspace
  4. Delete Podfile.lock file and Pods folder
  5. Run pod install.
  6. Open the newly created ProjectName.xcworkspace file and build.


Related Topics



Leave a reply



Submit