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:
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?)
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.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With