Closed short-dsb closed 5 months ago
with apologies, others are building fine (as are my projects) so this will not result in a change in this repository and so is not an issue, it's a project-specific problem
you and others may feel free to continue discussion here (and propose a PR to the docs if anything interesting is learned) but I don't have any time personally to troubleshoot project-specific problem
I suggest you build an example from scratch (starting with npx react-native init BuildTest
or similar and proving it can work, then figuring out why your project is not working
This appears to be due to migrating from v14 of the official Facebook SDK to this package, resulting in an FBSDKCoreKit-Swift.h
that was cached from the previous version. Running a clean build in Xcode resolved the issue.
However, this resulted in a new error:
❌ /Users/dsb/Library/Developer/Xcode/DerivedData/shortboxed-euoiztpisgpuzndyuevmudfutzne/Build/Products/Debug-iphonesimulator/XCFrameworkIntermediates/FBSDKCoreKit/FBSDKCoreKit.framework/Headers/FBSDKCoreKit-Swift.h:2519:146: cannot find protocol declaration for 'SFSafariViewControllerDelegate'
@interface _BridgeAPI : NSObject <FBSDKBridgeAPIRequestOpening, FBSDKApplicationObserving, FBSDKURLOpener, FBSDKContainerViewControllerDelegate, SFSafariViewControllerDelegate>
The problem was the order of the #import
statements. SafariServices.h
must be imported before FBSDKCoreKit-Swift.h
. It was being placed after due to my ClangFormat configuration, which declared SortIncludes: true
.
Hopefully this helps someone else. 🙂
@mikehardy You beat me to closing the issue. Thanks for your prompt response!
🐛 Bug Report
I’m unable to build our project for iOS with this library using Xcode 14.3 and React Native 0.72.7 (Android works as intended). I’ve tried both workarounds in the README and those on StackOverflow to no avail. I’ve also looked at the example project but haven’t spotted any differences that would cause this error.
Any help would be greatly appreciated. 🙂
To Reproduce
react-native run-ios
I’ve also tried
#import <FBSDKCoreKit/FBSDKCoreKit-Swift.h>
instead of#import <FBSDKCoreKit/FBSDKCoreKit.h>
, but I get a different error:Expected Behavior
Build completes successfully.
Code Example
AppDelegate.mm:
Podfile:
Environment