I am trying to add the Facebook SDK to my iOS 8 Objective-C app in Xcode. I did the install according to the FB-dev instructions. However, I get a "Could not build module 'FBSDKCoreKit'" error when I add the header to my AppDelegate.m file.
#import "AppDelegate.h"
#import <FBSDKCoreKit/FBSDKCoreKit.h>
Based on what I read elsewhere
I'm stumped.
FBSDKCoreKit can't be built because of "include of non-modular header inside framework module" error in FBSDKAppLinkResolver.h header file: in #import <Bolts/BFAppLinkResolving.h>
line.
The solution from Swift compiler error: "non-modular header inside framework module" (switching CLANG_ALLOW_NON_MODULAR_INCLUDES_IN_FRAMEWORK_MODULES = YES) did't help me.
My solution:
Put such code inside
framework module Bolts {
umbrella header "Bolts.h"
export *
module * { export * }
explicit module BFAppLinkResolver {
header "BFAppLinkResolver.h"
link "BFAppLinkResolver"
export *
}}
Interesting fact is that in FBSDKCoreKit such scheme is realized by Facebook, why didn't they apply it into Bolts...
Not sure if it has side effects but setting the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings solved the problem for me. Hope it works for you too.
Just doing the following let me to build the app successfully.
In Build settings Set "Allow Non-modular Includes in Framework modules" flag to YES
And I didn't want to Set "Enable Modules" (c and Objective-C) to NO
For Objective-C I used Paul Lehn answer from: https://developers.facebook.com/bugs/362995353893156/
- Add the -ObjC flag to your project's Other Linker Flags build setting. (if you don't want add to project configs, for initialise buttons classes)
- "Allow Non-modular Includes in Framework modules" setting to YES in Build settings
- Set "Enable Modules" (c and Objective-C) to No
(also don't forget add frameworks, for me it was: "AdressBook" "QuartzCore" "CoreLocation" "CoreGraphics" and if still not added, also "UIKit" "Foundation" "CoreData")
and its finally worked for me
all this used for linked FBSDK in custom folder in my project folder not from ~/Documents/FacebookSDK
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With