Open esbenvb opened 5 years ago
I keep getting this,
ld: framework not found FBSDKShareKit
Its crazy, I have added in framework search paths, still this error shows.
Tired from two days.
I ended up enabling cocoapods for the project and installing the FB SDK using cocoapods. However, that was also kind of a nightmare.
Made a podfile like this:
And then for every build error I added the dependencies from here https://github.com/facebook/react-native/blob/master/React.podspec (this file is not the same as the React.podspec
in my node_modules/react-native
folder).
But since the docs instruct the developer to skip the pod setup, and manually download and add the frameworks, I think that should be decscribed more detailed, since the current description obviously doesn't work :(
@gokulkulkarni1987 did you try going into RCTFBSDK.xcodeproj in the Libraries folder and fixing the Search Path there?
@Lloydza I unlinked and relinked all worked..
I solved my case of "file or lib not found" and without cocoapods, I think in XCode 10.x the typically Frameworks folder (~/Documents/FacebookSDK) was missing because this is out of the project so:
Created a folder Frameworks in ios folder and copy this the FacebookSDK folder.
In Build Phases of "main/react project" go to "Link Binary With Libraries" and add or fix the link of three FacebookSDK libs (FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework). NOTE: In "Build Phases" there is "Embed Frameworks" a section but I think there is nothing to do here in this case, if there are some FacebookSDK libs links here remove it.
More fixes can be needed:
Environment
IDE:
Xcode: 10.1
npmPackages:
react: 16.8.6
react-native: 0.59.9
react-native-fbsdk: 0.10.1
FacebookSDK: 5.1.1
Inspired in this solution posted by @SvetoslavSlavov check it, worked for me: https://github.com/facebook/react-native-fbsdk/issues/452#issuecomment-463283195
I finally got mine to work after using CocoaPods, see: https://github.com/facebook/react-native-fbsdk/pull/551#issuecomment-506548286
🐛 Bug Report
I tried following the guide and chose NOT to use cocoapods. I have downloaded the SDK files and copied them to the "Frameworks" group of the xcode project by dragging in the
.framework
file for Core, Login and Share. I also added the-ObjC
linker flag.The frameworks are present in "Linked frameworks and libraries" and I also added them to "Embedded binaries"
I both tried with the version 5.0 and 4.4.x if the frameworks. Same result.
On a brand new RN 0.59.8 project it won't even build, but fails at
#import<FBSDKShareKit/FBSDKShareKit.h>
On an existing app project based on 0.59.5, it builds but crashes at launch, saying
To Reproduce
react-native init TestProject && cd TestProject && yarn add react-native-fbsdk && react-native link react-native-fbsdk
Expected Behavior
Expected the app to build and run
Environment