9

I'm building an app using react native that uses FBSDK (react-native-fbsdk). The whole thing worked without an issue, but after I update my Xcode from 9.4 to 10.0, I'm no longer able to build the project due to error:

'FBSDKShareKit/FBSDKShareKit.h' file not found

I've found a number of questions that seems to be having the same issue and tried their suggestion, but still can't build successfully. Things I've tried:

  1. Adding "~/Documents/FacebookSDK" to Framework Search Path
  2. Make sure FBSDK[Core, Share, Login]Kit.framework and libRCTFBSDK.a are in Link Binary with Libaries
  3. Using "rm -rf ~/Library/Developer/Xcode/DerivedData" to clean data then tried to build again
  4. Removing the Frameworks from FacebookSDK folder then added them again

At this point, I'm not sure what else I should try. The weirdest thing is that it was working before updating Xcode, so does that mean there's a change in Xcode itself that caused this?

Anyone have any idea on this or have faced this issue?

EDIT: I've managed to successfully build the project by changing the Build System from New Build System to Legacy Build System. The app now runs (maybe there's something changed in the way Xcode build projects now that's incompatible with the current fbsdk?)

rabbit87
  • 3,165
  • 2
  • 20
  • 29

3 Answers3

10

I finally managed to build the project while setting the Build System to New Build System by adding in

$(PROJECT_DIR)/../../../ios

into RCTFBSDK's (target) Framework Search Paths.

My guess is that; due to the .frameworks file is located in ios folder instead of ios/Frameworks, the project can't find the necessary file. (Why it works if I used Legacy Build System is still a mystery to me).

I've tested in both emulator and device; both seems to be working fine.

rabbit87
  • 3,165
  • 2
  • 20
  • 29
4

What worked for me:

I created a Frameworks folder in the ios folder and moved all the fdsdk file into.

Then I had to remove FBSDK[Core, Share, Login]Kit.framework and libRCTFBSDK.a from "Link Binary with Libraries" (you access it in your project then build Phases) then add the 3 FBSDK[Core, Share, Login]Kit.framework again from the Frameworks folder + libRCTFBSDK.a

I cleaned the derivedData folder

rm -rf ~/Library/Developer/Xcode/DerivedData

Then the build was successful with the new build system.

Hope this may help other people.

Thanks @rabbit87 and @kalid for their help

Pierre
  • 675
  • 1
  • 8
  • 18
0

For anyone that still struggles with this issue, what worked for me was not only you have to change the Framework Search Paths from the main project, but you will have to change the path from within the RCTFBSDK.xcodeproj itself which is located in the Libraries folder.enter image description here

conchimnon
  • 41
  • 1
  • 1
  • 10