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
Got this issue too, you need to set
Enable Modules (C and Objective-C)
to NO.
You're probably importing the "Samples" folder that comes with Facebook's SDK into your project. Remove the references to those files from your project and it should work. No need to change flags on your build settings.
Same issue was with me. ... Non of the above solution works for me.. I set . modules, flags and other things also... but nothing help to it.
But for me this issue is solved by
MOVE your framework folder AFTER or WITHIN the folder where .pch file is located at.
When my framework folder
@ myapp/{frameworkFolder}/fbframeworks.
It was showing issues.
I move it to myapp/myapp/modal/{fbframework}/.
Then this issue was solved. (my .pch file is located at myapp/myapp.)
May be the same can help to anyone having same issue.
I have faced the same problem. The issue was that my project directory contained space in the name "Application Demo". That's why whenever I dragg the Facebook frameworks then it added space in Framework Search Paths in settings. Remove this space resolved the issue.
From Chris Pan (Facebook Team): https://developers.facebook.com/bugs/362995353893156/
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)
As far as I know, we have 2 options to deal with this problem:
For those who came here and made the same rookie mistake like I did. Maybe I can save you some time. I work on an old project which largely consists of Objective-C code. We try to implement new stuff in Swift.
This was what i tried in my Swift code
import FBSDKCoreKit
class SomeClass {
func doSomething {
FBSDKAppEvents.logEvent("Some Event")
}
}
But the compiler complained that it could not compile the module, etc.
How I solved it
import FBSDKCoreKit
from my Swift code.Bridging-Header.h
and imported FBSDKCoreKit
there: #import <FBSDKCoreKit/FBSDKCoreKit.h>