美文网首页
reactnative 项目报错

reactnative 项目报错

作者: cw0925 | 来源:发表于2017-06-02 15:10 被阅读55次

“RCTBundleURLProvider.h” file not found

1、从网上下载别人的ReactNative项目,打开iOS项目的时候,xcode会报错,提示:“RCTBundleURLProvider.h” file not found

解决方法:

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

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

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

最后重新打开Xcode,clean一下,应该就没有问题了,我的就是这么解决的。

2、RCTRootView 属于react-native依赖中的类,

你需要在工程目录下,npm install react-native,如果你项目中有npm package文件,直接运行npm install即可安装配置文件中的依赖;基本就可以了。

如果确认已经依赖,则添加link:Link Binary with Library-->Add Other --> node_modules -> react-native -> React -> Base -> RCTRootView.m

相关文章

网友评论

      本文标题:reactnative 项目报错

      本文链接:https://www.haomeiwen.com/subject/nedufxtx.html