ReactNative' React / RCTBundleURLProvider.h'使用react-native-fbsdk找不到文件

时间:2017-09-28 18:05:34

标签: ios facebook react-native facebook-sdk-4.0

我通过flfl指令安装了react-native-fbsdk。 https://github.com/facebook/react-native-fbsdk

但是,我在AppDelegate.m

中收到错误

'阵营/ RCTBundleURLProvider.h'找不到文件

#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h> <- Error here
#import <React/RCTRootView.h>
#import "RNFIRMessaging.h"

卸载react-native-fbsdk解决了这个问题所以显然这个库导致了这个问题。 我试过的东西是

  1. 编辑此类React Native 0.40.0 : RCTBundleURLProvider.h” file not found - AppDelegate.m
  2. 的架构
  3. 安装不同版本(0.5,0.6,0.6.1)
  4. 关注SnehaGindi对https://github.com/facebook/react-native/issues/12077
  5. 的评论

    所有这些都没有用。

    我的package.json如下所示。 有什么线索吗?

    {
      "name": "BitcoinApp",
      "version": "0.0.1",
      "private": true,
      "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
      },
      "dependencies": {
        "axios": "0.16.2",
        "moment": "2.18.1",
        "native-base": "2.1.5",
        "react": "16.0.0-alpha.12",
        "react-base": "0.2.0",
        "react-native": "0.45.1",
        "react-native-app-intro": "1.1.5",
        "react-native-fbsdk": "^0.6.0",
        "react-native-fcm": "^7.5.1",
        "react-native-firebase-analytics": "^3.0.2",
        "react-native-gifted-form": "0.0.14",
        "react-native-loading-spinner-overlay": "0.5.0",
        "react-native-pathjs-charts": "0.0.29",
        "react-native-scrollable-tab-view": "0.6.6",
        "react-native-social-share": "^1.1.0",
        "react-native-store": "0.4.1",
        "react-navigation": "1.0.0-beta.11"
      },
      "devDependencies": {
        "babel-jest": "20.0.3",
        "babel-preset-react-native": "1.9.2",
        "eslint-config-rallycoding": "^3.2.0",
        "jest": "20.0.4",
        "react-test-renderer": "16.0.0-alpha.12"
      },
      "jest": {
        "preset": "react-native"
      }
    }
    

1 个答案:

答案 0 :(得分:0)

解决。

卸载SDK并再次阅读后续说明。 https://developers.facebook.com/docs/ios/getting-started/

这一次,在&#34;步骤2:下载适用于iOS的Facebook SDK&#34;,将SDK放入&#34;〜/ Documents / FacebookSDK&#34;。

因此,导致此问题的原因是SDK目录不在&#34;〜/ Documents / FacebookSDK&#34;。