我在创建react-native项目时 npm了一个第三方库 结果一打开 xcode 竟然报错 React/RCTBundleURLProvider.h' file not found;
然后 我试了各种网上的方法试了一遍, 还是不行
就在我要放弃的时候 ,突然想到把网上的方法 结合一下 试试,结果好了。
以下就是我的解决方法
打开Mac里面的终端,进入项目所在的文件夹目录;
把项目里面的 node_modules 文件夹删除掉,然后执行 npm install 命令
npm install安装完成后, 执行react-native upgrade命令
npm start
打开xcode (如果还报错)
左侧点击跟项目目录 -> 选择右侧 Build Settings -> 选择 All & Combined -> 搜索框输入 Always Search User Paths -> 将 Always Search User Paths 设置为 Yes -> Clean -> Build
这样就不会出错了!
以下是两个方法链接的地址
https://hacpai.com/article/1497235254333
http://blog.csdn.net/csdn2314/article/details/71215607
---------------------
作者:默燃灬
来源:CSDN
原文:https://blog.csdn.net/qq_37481081/article/details/79010987
版权声明:本文为博主原创文章,转载请附上博文链接!