38

I am having issue while updating Facebook SDK 3 to 4

when I add the framework it was added successfully. but when i add header file it's having the error that " Could not build module 'FBSDKCoreKit' ". Don't know the reason.

Error Could not build module 'FBSDKCoreKit'

Premal Khetani
  • 3,175
  • 1
  • 26
  • 58

14 Answers14

83

In setting the "Allow Non-modular Includes in Framework modules" setting to YES in Build settings solved the problem for me. but don't know if is there any problem or issue or any side effects of it.

Its Facebook Bug you can check the solution they are providing in this link.

Update 1

Facebook said that they have fixed and will apply solution in next update see this link

Update 2

FaceBook Fixed It in Version Latest version (i.e. 4.1.0) see this link link.

Premal Khetani
  • 3,175
  • 1
  • 26
  • 58
  • 5
    I have same issue and also I have set YES to "Allow Non-modular Includes in Framework modules", but it did not get solve. – Sunil Zalavadiya Apr 06 '15 at 07:06
  • 2
    @sunilz i don't know the reason behind it but also do check all the settings as per https://developers.facebook.com/docs/ios/getting-started#configure . – Premal Khetani Apr 06 '15 at 07:07
  • 1
    @PremalKhetani, could you direct me where to find this setting ("Allow Non-modular...). I can't seem to find it – David Ben Ari Apr 21 '15 at 19:18
  • 2
    stupid me. I had the build settings pane display only basic settings and not all.. – David Ben Ari Apr 21 '15 at 19:20
  • 1
    Do as @PremalKhetani and also add Bolts.framework: "If you are writing an Obj-C app, make sure Xcode can locate Bolts.framework is in your project's Framework Search Paths. For example, if you copy the FBSDK*Kit.frameworks to your project's directory, make sure you copied Bolts.framework as well." – ConfusedDeer Apr 22 '15 at 03:07
  • 3
    Facebook always have bugs bugs bugs bugs – LightNight Apr 30 '15 at 08:30
  • It's 2017 and I got this error and setting the Build setting as posted in this answer inly resolved it. :( – Anjan Biswas Jun 12 '17 at 01:02
25

i have also facing same issue and i got solution. Nothing do just Remove the Module folder in. Follow simple step

step 1. go to Document/FacebookSDK folder

step 2. Go inside FBSDKCoreKit.framework folder & remove Modules folder. then drag and drop in your Xcode Project.

Resolve your issue. Enjoy .... !!!

Fahim Parkar
  • 30,974
  • 45
  • 160
  • 276
Raj Chavda
  • 251
  • 2
  • 3
  • I am just wondering, how did you figure this out ? Thank you very much anyway, because it works but my tiny little brain can't figure out why. – Chan Tak Zee Mar 20 '17 at 11:54
  • Tried this and not working :( , Have been spending 3 days to solve this problem. – Sooraj Jun 23 '17 at 17:34
21

I have tried the above solutions but did not work for me.Finally after scratching head for sometime i came across below solution:

I changed my framework search path after which my issue was resolved.

Steps to find Framework search Path

Goto build setting of the project and search for framework search path.

Then add the below line

"~/Documents/FacebookSDK"

enter image description here

.....

enter image description here I hope this will help someone .

ABS
  • 7,634
  • 1
  • 21
  • 20
7

If your using cocoapods, go to Pods Project Build Settings and change "Allow Non-modular Includes in Framework modules" to YES

John Paul Manoza
  • 1,735
  • 25
  • 22
6

When adding Facebook SDK (Version 4) files to the project make sure to uncheck "Copy into destination group folder".

This solved a problem for me.

KTZ
  • 139
  • 5
1

Facebook has recognized the issue and said they're working on a fix.

In the meantime, here is the link to the available solutions depending on your project.

George Marmaridis
  • 1,814
  • 1
  • 13
  • 15
1

The updated FacebookSDK v4.1.0 launch on 30th April 2015 solved the following issue.

You might face a warning. Go to FBSDKCoreKit.framework/Headers/FBSDKCoreKit.h and add #import < FBSDKCoreKit/FBSDKTestUsersManager.h > to fix it.

chinweekoh
  • 41
  • 5
1

I got the same issue and solve problem.
My solution :
1. follow the steps from https://developers.facebook.com/docs/react-native/getting-started-ios
2. check the xcode proj -> Library, find and open file RCTFBSDK.xcodeproj then update fb sdk path in build setting->Framework search path.

It works. I guess that sometime the RCTFBSDK.xcodeproj in Library can not update the framework search path from main xcodeproj so we need done manually. Hopefully my solution can help you, Thanks.

Jack Diff
  • 71
  • 1
  • 1
  • 4
1

And also this issue happens if you are open .xcodeproj file instead of .xworkspace file.

isuru
  • 3,385
  • 4
  • 27
  • 62
0

change In target setting "Allow Non-modular Includes in Framework modules" to YES

Mohit Tomar
  • 5,173
  • 2
  • 33
  • 40
0

With me, just download new version of Facebook SDK, then remove the old and add new fixed the problem.

lee
  • 7,955
  • 8
  • 44
  • 60
0

If you have multiple targets in your project, make sure that the "Target Membership" for the required frameworks is ticked for the target you're trying to build for.

When you drag the frameworks into XCode, you can usually choose the target, but it's an easy thing to miss.

Mick Byrne
  • 14,394
  • 16
  • 76
  • 91
0

I faced the same issue, but i was running project on old Xcode version. Make sure you are using latest SDK with latest Xcode version.

Gurjinder Singh
  • 9,221
  • 1
  • 66
  • 58
0

As In My Case, The problem was caused by cocoapod configs, I just updated the cocoapod version to 1.5.3 (currently it's the latest version) by using the following command:

sudo gem install cocoapods

Then, I simply updated all the pods I use.

pod update

Then voalá, the error is gone.

Ahmad Al-Attal
  • 435
  • 4
  • 13