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

徘徊边缘 提交于 2020-01-15 10:57:11

问题


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.


回答1:


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!



来源:https://stackoverflow.com/questions/44236737/facebook-sdk-not-working-if-i-place-the-sdk-folder-inside-react-native-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!