“RCTBundleURLProvider.h” file not found
1、從網(wǎng)上下載別人的ReactNative項(xiàng)目,打開iOS項(xiàng)目的時(shí)候,xcode會(huì)報(bào)錯(cuò),提示:“RCTBundleURLProvider.h” file not found
解決方法:
打開Mac里面的終端,進(jìn)入項(xiàng)目所在的文件夾目錄;
把項(xiàng)目里面的node_modules文件夾刪除掉,然后執(zhí)行npm install命令
npm install安裝完成后, 執(zhí)行react-native upgrade命令
最后重新打開Xcode,clean一下,應(yīng)該就沒有問題了,我的就是這么解決的。
2、RCTRootView 屬于react-native依賴中的類,
你需要在工程目錄下,npm install react-native,如果你項(xiàng)目中有npm package文件,直接運(yùn)行npm install即可安裝配置文件中的依賴;基本就可以了。
如果確認(rèn)已經(jīng)依賴,則添加link:Link Binary with Library-->Add Other --> node_modules -> react-native -> React -> Base -> RCTRootView.m