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
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
I got the same problem, I was using the newest Facebook SDK (FacebookSDKs-iOS-20160316) on Xcode 6.4, it consistently gives me this error whenever I put the following code in my AppDelegate.m
file:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
When I switched to Xcode 7.2, problem solved, the error is gone. Guess this maybe the version compatible issue
If you are facing the same issue with me, you can have a try to use Xcode 7.2 to build it. Problem is Xcod 6.4 may never be able to used as long as you keep the Facebook sdk in your project.
Hope this helps!
Make sure you've also imported the Bolts framework, this worked for me.
If you are having issue with 'FBSDKCoreKit' You can try below solutions:
Goto Build Setting and search for "allow non-modular" and Set
"Allow Non-modular Includes in Framework modules" flag to YES
Go to Document/FacebookSDK folder
then goto FBSDKCoreKit.framework
In this folder Remove Modules folder. Then add the FacebookSDK library in your project.
Set the Framework search path to "~/Documents/FacebookSDK"
Steps to find Framework search Path
Goto build setting of the project and search for "framework search path".
Then add "~/Documents/FacebookSDK"
Edit:
please open the Framework search path in Facebook app and copy paste all the paths mentioned over there in your application.Similar to the path i have attached in below screen shots
This will fix your problem
I should direct you to this current open issue assigned to Facebook: https://developers.facebook.com/bugs/362995353893156/. None of the answers here helped me, so I assume we just sit ducks:
As at time of writing, a message from Facebooks Chris Pan:
"The 4.0.1 release added module maps (which should have obviated the need for bridging headers) but it looks like that may have caused some other compatibility issues. We're working on a proper fix but another workaround is to remove the module maps manually from each of the FBSDK*Kit.framework bundles; e.g., rm -r ~/Documents/FacebookSDK/FBSDKCoreKit.framework/Modules/
(and repeat for FBSDKLoginKit and FBSDKShareKit)"
Kosala Ubayasekara got it to work, but since this is an open issue you might want to simply wait until an official fix is clear:
In Build Settings under Apple LLVM Modules:
Create a bridging header to include the Facebook SDK headers