Build error: FBSDKShareKit.h file not found after upgrading to Xcode 10
Asked Answered
B

3

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?)

Blastoderm answered 20/9, 2018 at 5:14 Comment(7)
Can you try deleting your node_modules folder, delete your iOS/build folder, run npm install and build the project again?Kudva
@Kudva unfortunately that doesn't seem to work either. I only managed to build it after changing the Build System option to "Legacy Build System"Blastoderm
@Blastoderm I am facing the same problem after updating Xcode.Thulium
@Thulium have you tried changing the Build System like I wrote? Did that allow you to build?Blastoderm
changing the build system to legacy is the only thing that worked for me.Othilie
Where is the option to change build system? I can't seem to locate it in preferences or build settings...?Gosling
@Gosling you can find them in File > Workspace SettingsBlastoderm
B
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.

Blastoderm answered 21/9, 2018 at 5:4 Comment(2)
Yeah I have created a folder Frameworks in ios folder and moved all the fdsdk file. and now its working with New Build System.Thulium
Finally I found an answer, I tried to fix this in all possible ways , and this helped me! Thank you!Licht
A
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

Areopagite answered 24/9, 2018 at 3:20 Comment(0)
A
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

Arquit answered 17/1, 2019 at 2:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.