Mac環(huán)境下,在命令行中run-ios構(gòu)建時報錯:CFBundleIdentifier", Does Not Exist
打開XCode,進(jìn)入.xcodeproj文件,運(yùn)行,編譯時報錯:'boost/iterator/iterator_adaptor.hpp' file not found’
這個問題只在react native 0.45.0及以后的版本中出現(xiàn),stackoverflow 上的各種方法均無效。
先貼出解決方法 如下:
這個問題產(chǎn)生原因:
/Users/你的用戶名/.rncache中boost_1_63_0.tar.gz,double-conversion-1.1.5.tar.gz,folly-2016.09.26.00.tar.gz,glog-0.3.4.tar.gz文件不完整。或者node_modules/react-native/third-party 文件不完整。
具體操作:
1、刪除/user/你的用戶名/.rncache目錄下的boost_1_63_0。重新下載,下載網(wǎng)址http://www.boost.org/users/history/version_1_63_0.html
2、打開命令行工具,在項目目錄下輸入rm -rf node_modules && rm -rf ~/.rncache && yarn
3、npm install
4、react-native upgrade
5、react-native run-ios
_________________________________________________________________________
若以上方法無效,可采用下面的方法:
創(chuàng)建項目暫時先使用react-native init MyApp –version 0.44.3,指定某個版本。
你可以使用–version參數(shù)(注意是兩個杠)創(chuàng)建指定版本的項目。例如react-native init MyApp -version 0.44.3。注意版本號必須精確到兩個小數(shù)點(diǎn)。