Facebook sdk not working if I place the sdk folder inside react-native project?
Asked Answered
R

1

1

I am wanting to manually link the Facebook SDK because we don't use cocoapods & don't want to implement it. But for some reason when we build our app on buddybuild, it will fail.

What I've done is placed the FacebookSDK folder inside (not an optimal solution I know):

ios/<ProjectName>/FacebookSDK

I added this folder ($(SRCROOT)/ios/<ProjectName>/FacebookSDK) to the framework search header paths & it still seems to throw errors.

1850
    ▸ Compiling RCTFBSDKShareDialog.m
1851
    » In file included from node_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.m:19:
1852
    ✗ node_modules/react-native-fbsdk/ios/RCTFBSDK/share/RCTFBSDKShareDialog.h:21:9: fatal error: 'FBSDKShareKit/FBSDKShareKit.h' file not found
1853
    » #import <FBSDKShareKit/FBSDKShareKit.h>
1854
    »         ^
1855
    ▸ Compiling RCTFBSDKAppEvents.m
1856
    » In file included from node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAppEvents.m:19:
1857
    ✗ node_modules/react-native-fbsdk/ios/RCTFBSDK/core/RCTFBSDKAppEvents.h:21:9: fatal error: 'FBSDKCoreKit/FBSDKCoreKit.h' file not found
1858
    » #import <FBSDKCoreKit/FBSDKCoreKit.h>
1859
    »         ^
1860
    ** BUILD FAILED **
1861
    The following build commands failed:
1862
        CompileC /tmp/sandbox/582d62aa1d76fc0100f1f6dd/bbbuild/Build/Intermediates/RCTFBSDK.build/Release-iphoneos/RCTFBSDK.build/Objects-normal/armv7/RCTFBSDKAppEvents.o RCTFBSDK/core/RCTFBSDKAppEvents.m normal armv7 objective-c com.apple.compilers.llvm.clang.1_0.compiler
1863
    (1 failure)

Any ideas to what I can do? It'd be nice if we could use this solution for now so that all developers (and the buddybuild CI) can pull it instead of having to download the SDK and put it documents folder.

Rectangle answered 29/5, 2017 at 7:23 Comment(0)
S
3

This is generally a result of an incorrectly configured repository with regards to the location of FBSDK dependencies.

If you take a look at: https://github.com/facebook/react-native-fbsdk/blob/master/ios/RCTFBSDK.xcodeproj/project.pbxproj

You will notice that RCTFBSDK will look for dependencies in one of two locations:

~/Documents/FacebookSDK
$(PROJECT_DIR)/../../../ios/Frameworks

The second option is the correct option for continuous integration systems like buddybuild.

In other words, you MUST place your FBSDK dependencies under the "ios/Frameworks" folder in order for it to work on a continuous integration system.

You can find more information about this in our react-native documentations.

Please let me know if this helps!

Saffier answered 10/11, 2017 at 15:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.