Closed hasnainsakir99 closed 5 years ago
I am also getting this issue even I installed FacebookSDK in ~/Documents/FacebookSDK
folder.
Anyone has any idea?
this issues coming from latest xcode(10.x) facebook login working with xcode 9.x
If you use pods, you can remove the references to the fbsdk lib from the xcode project and instead add:
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
pod 'FBSDKCoreKit', '4.38'
pod 'FBSDKLoginKit', '4.38'
pod 'FBSDKShareKit', '4.38'
to your podfile
For XCode 10.x the Frameworks folder was missing for me. I created a folder Frameworks in ios folder and add inside Bolts.framework, FBSDKCoreKit.framework, FBSDKLoginKit.framework, FBSDKShareKit.framework. Then i link the libraries again. I go to Link Binary With Libraries remove them and add them again. The other possible issue can be if the Documents directory is in the iCloud. Then the files are not in your computer but they are stored in the cloud. You have to disable the cloud from Settings.
this issues coming from latest xcode(10.x) facebook login working with xcode 9.x @Jithinag007 So what is the solution to make it works in Xcode 10?
The pods solution works in Xcode 10 👍
Hi @noahtallen, i don't think leaving
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
line and doing pod install
is a good idea because it installs React
and other dependencies
@elhachimi, if you're already linking libraries through Pods which depend on react native, you'd probably already be installing react through pods too. At least in my case, all of my native 3rd party dependencies (including react native) go through pods
@noahtallen i noticed that with only
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
in podfile does also install FBSDKCoreKit
, 'FBSDKLoginKit'
...
Hmm that's great! I'm not sure if I tested just adding the rn-fbsdk pod without the others, but it'd be great to hear if login still works without those!
What finally worked for me was:
npm install plist xcode adm-zip
] which i think can be safely removed/uninstalled after everything is done, though there is no explicit mention in the instructionsFacebookSDK_Static.zip
from here, currently at v5.2.3
.Frameworks
directory in Xcode
Framework Search Paths
, besides ~/Documents/FacebookSDK
, added $(HOME)/Documents/FacebookSDK
, /Users//Documents/FacebookSDK
, /Users/my_username/Documents/FacebookSDK
. I really don't think they are all required but i have it there from other suggestions.I tried all possible variations (with/without pods, different versions of sdks, drag drop linking, consuming React as a pod etc etc) but i was getting one error or the other.
I am on react-native v0.59.10
with react-native-fbsdk
at 0.10.1
I got this to work by using a variation of @noahtallen 's comment. I also removed the libs from xcode and used pods however I used
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk' pod FacebookSDK
instead of the pods that @noahtallen used for the facebook SDK as those are deprecated now. However, to use this setup, react native must at version 0.60.0 or above, because the new SDK doesn't work with earlier versions.
@IAmMarcellus can you help me out please? I'm also using RN 0.60.4 with CocoaPods. Do i need to add the FacebookSDK under my ~/Documents and import the .framework files or that is no longer needed? These are the versions that are installing on my pod install
Analyzing dependencies
Fetching podspec for `react-native-fbsdk` from `../node_modules/react-native-fbsdk`
Downloading dependencies
Installing Bolts (1.9.0)
Installing FBSDKCoreKit (5.3.0)
Installing FBSDKLoginKit (5.3.0)
Installing FBSDKMarketingKit (4.38.0)
Installing FBSDKPlacesKit (5.3.0)
Installing FBSDKShareKit (5.3.0)
Installing FacebookSDK (4.44.1)
Installing React (0.11.0)
Installing react-native-fbsdk (1.0.1)
Generating Pods project
Integrating client project
Sending stats
Pod installation complete! There are 5 dependencies from the Podfile and 9 total pods installed.
[!] React has been deprecated
But I keep getting the 'FBSDKCoreKit/FBSDKCoreKit.h' file not found error.
This is my Pods file
# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'
install! 'cocoapods', :deterministic_uuids => false
target 'MyApp' do
# Comment the next line if you don't want to use dynamic frameworks
use_frameworks!
# rn_path = '../node_modules/react-native'
# pod 'yoga', path: "#{rn_path}/ReactCommon/yoga/yoga.podspec"
# pod 'React', path: rn_path, subspecs: [
# 'BatchedBridge',
# 'Core'
# ]
# Pods for MyApp
pod 'FacebookSDK'
pod 'FacebookSDK/LoginKit'
pod 'FacebookSDK/ShareKit'
pod 'FacebookSDK/PlacesKit'
pod 'react-native-fbsdk', :path => '../node_modules/react-native-fbsdk'
target 'MyAppTests' do
inherit! :search_paths
# Pods for testing
end
end
post_install do |installer|
installer.pods_project.targets.each do |target|
# The following is needed to ensure the "archive" step works in XCode.
# It removes React & Yoga from the Pods project, as it is already included in the main project.
# Without this, you'd see errors when you archive like:
# "Multiple commands produce ... libReact.a"
# "Multiple commands produce ... libyoga.a"
targets_to_ignore = %w(React yoga)
if targets_to_ignore.include? target.name
target.remove_from_project
end
end
end
Any ideas?
finally worked.
I have created an empty project and setup a Facebook app and configured my plist file with the correct ID when I import the FBSDKCoreKit and FBSDKLoginKit and import the project in my bridging header I get an error saying ''FBSDKCoreKit / FBSDKCoreKit.h' file not foundt'. The error goes away once I take away these lines of code:
import <FBSDKCoreKit/FBSDKCoreKit.h>