In a custom framework containing both Objective-C and Swift code, the Swift compiler throws the following error:
[build_pat
If you're using Xcode 7.1 and CocoaPods 0.39, there seems to be a swift compiler change that affects some CocoaPods (Nimble, Quick, etc.) Try some of the solutions specified in the this thread: https://github.com/CocoaPods/CocoaPods/issues/4420 however, if neither of them work, try using Xcode 7.0.1 or 7.2 beta. You can get both of them here: https://developer.apple.com/downloads/.
Edit: In my case, to fix the issue, I also had to downgrade CocoaPods to 0.38.2.
Later edit: It seems not to be related to Xcode 7.1. Just downgrading CocoaPods to 0.38.2 should help:
sudo gem uninstall cocoapods -v 0.39
sudo gem install cocoapods -v 0.38.2
make sure "import paths" in Build Settings includes the file you're trying to include...
I fixed it by making the Compilation Mode of the problematic framework build settings to Incremental.
In my case problem was caused by remove headers script in Build Phases
function removeHeaders() {
find $BUILD_ROOT/... -name '*.h' -exec rm -f {} \;
}
removeHeaders
Deleting this script fixed the problem.
One more solution: After renaming a folder, the old location might still be listed in the project file for the .h file, even if you updated the location via Xcode's side-bar. This old location causes the umbrella-header error.
Simple solution: Remove the reference to the .h file, and re-add. (and then remember to make it public again!)
Your header file needs to be in the [Build Phases/Headers/Public] section.
If your header file is already in the [Build Phases/Headers/Public] section, many times doing the fallowing solved my problem: