Now I would like to migrate my ObjC framework to Swift and I got the following error:
include of non-modular header inside framework module 'SOGraphDB'
The references is to a header file which just define a protocol and I use this header file in some classes to use this protocol.
Is seems related to the module feature but it is at the moment not quite clear how to fix, do you know a solution?
UPDATE:
This is a Swift compiler error.
UPDATE 2:
A quick fix (but not solving the root cause) is to set the following setting to yes: CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES
I had the specific problem with Facebook 4.02 sdk and FBSDKCoreKit.
I did all the steps but still error about non modular header. i drag and dropped only the specific header from the framework to build phases-> header section.
Then automatically created a copy of the header on the project navigator at the top.
I removed it from the build phases -> header and deleted the new file and worked fine.
Like it reseted or something.
Switching Build settings > Allow non-modular includes in Framework Modules to YES! solved the same issue for me.
After allowing to import non modular includes, you could try to import that module using Objective-C Bridging header:
The header file was allocated to the target but was only marked as project visible, just a change to public lead to the resolution of this error.
Here's how to automatically apply the quick fix so you don't have to change
Pods.xcodeproj
manually after eachpod install
.Add this snippet to the end of your Podfile:
In my case (Xcode 9 beta 6 - Swift 4 - using Cocoapods) this was solved when I deleted Podfile.lock and the Pods directory and ran
pod install
again