5

I am trying to add the Facebook SDK to my iOS 9.0 Swift app in Xcode. I did the install according to the FB-dev instructions. However, when I add the header to my AppDelegate.m file import FBSDKCoreKit I keep getting a message saying "No such module 'FBSDKCoreKit'" error .

Based on what I read elsewhere

  1. I have already cleaned the build and re-installed Xcode and updated my OS X
  2. I have double checked the plist and the framework files FB lists in the instructions, but nothing has seemed missing.
  3. I have set the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings.

Nothing seems to work. I do not know where to go from here and have done hours of research trying to find the solution.

4 Answers4

8

When you are importing the frameworks, Make sure you have selected "Copy if needed" . Version after Xcode 6.3 seem to be giving issues if this part is NOT ticked.

Jignesh
  • 310
  • 3
  • 12
6

I solved this by deleting the Framework and adding it again by right click on the project->Add files..., then choose the framework and SELECT the option to Copy files if needed. It's not what Facebook recommends, but it worked! I'm using v4.6 of FBSDK and Xcode 7 beta 6. Hope it helps you and everyone else who's facing the same problem :)

maufadel
  • 506
  • 5
  • 10
1

With CocoaPods, swift 2.1, and iOS 9, I tried adding it to the bridge header and it works fine, for example:

#ifndef MY_Bridge_Header_h
#define MY_Bridge_Header_h

#import <FBSDKCoreKit/FBSDKCoreKit.h>
#import <FBSDKLoginKit/FBSDKLoginKit.h>
// ... other imports

#endif /* MY_Bridge_Header_h */
Yuchen
  • 30,852
  • 26
  • 164
  • 234
0

I had errors following alongside the AppCoda tutorial which is not fully up to date. I recommend following Facebooks own instructions. The issue for me was that I had to add the frameworks to my project and then add sdk search path. After that I could import without an error.

cheznead
  • 2,589
  • 7
  • 29
  • 50