简体   繁体   中英

Facebook SDK causes React Native build to fail

My team is building our first iOS app using React Native. For some reason on my Mac only, the build fails after running react-native run-ios . This has been happening since we added Facebook authentication with the react-native-fbsdk .

We are all running node -v 7.0 and the latest version of Xcode. I have even tried deleting the repo locally and cloning it back down. As an experiment, another member of my team deleted his repo locally, cloned it back down, and was able to get everything working. We sat next to each other and did the exact same steps and it worked for him but not me.

Below is the error message I receive in my terminal:

** BUILD FAILED **


The following build commands failed:
CompileC /Users/philmok/js_projects/pLot/ios/build/Build/Intermediates/RCTFBSDK.build/Debug-iphonesimulator/RCTFBSDK.build/Objects-normal/x86_64/RCTFBSDKGraphRequestManager.o RCTFBSDK/core/RCTFBSDKGraphRequestManager.m normal x86_64 objective-c com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/pLot.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/pLot.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Per the answer on this question , I have tried running react-native upgrade . This will allow the build to complete but it prevents Facebook authentication from working.

Make sure you have downloaded the FBSDK for fb login. Place it in your documents folder and then open your project in xcode. click your project in the left menu and select the build settings tab, give 'framework path' the path to your FBSDK in documents.

add

  pod 'FBSDKCoreKit'
  pod 'FBSDKLoginKit'
  pod 'FBSDKShareKit'

to your Podfile and then pod install

Did you went through all configuration steps? Here is great introduction, step by step how to add facebook sdk to react native app: https://github.com/magus/react-native-facebook-login . Btw. I recommend to use this lib if you can, I had many problems with official facebook sdk, moved to that one, and everything works.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM