ReactNative Ios报出 'React/RCTBundleURLProvider.h' file not found错误

我在创建react-native项目时  npm了一个第三方库  结果一打开 xcode 竟然报错 React/RCTBundleURLProvider.h' file not found;

然后 我试了各种网上的方法试了一遍, 还是不行

就在我要放弃的时候 ,突然想到把网上的方法 结合一下 试试,结果好了。

以下就是我的解决方法

  1. 打开Mac里面的终端,进入项目所在的文件夹目录;

  2. 把项目里面的 node_modules 文件夹删除掉,然后执行 npm install 命令

  3. npm install安装完成后, 执行react-native upgrade命令

  4. npm start

  5. 打开xcode (如果还报错)

  6. 左侧点击跟项目目录 -> 选择右侧 Build Settings -> 选择 All & Combined -> 搜索框输入 Always Search User Paths -> 将 Always Search User Paths 设置为 Yes -> Clean -> Build
    ReactNative Ios报出 'React/RCTBundleURLProvider.h' file not found错误这样就不会出错了!

以下是两个方法链接的地址
https://hacpai.com/article/1497235254333
http://blog.csdn.net/csdn2314/article/details/71215607