执行pod install报错。通过cocoapods引入RN代码里面语法报错,分析cocoapods语法依赖于ruby,通过查看ruby版本(ruby -v),ruby版本为2.1.0,升级ruby版本到2.3.0以上即可。
/ReactComponent/node_modules/react-native/React.podspec
package = JSON.parse(File.read(File.join(_dir_,"package.json")))
version = package['version']
rbenv install 2.5.0 ---->安装最新的ruby环境2.5.0,安装好之后,查看ruby版本,ruby -v。
sudo gem install cocoapods ---->重新安装cocoapods。
gem install xcodeproj ---->重新安装xcodeproj。cocoapods基于ruby,需要导入xcodeproj库。
pod repo remove master
pod setup
pod install
执行pod install报错。
RuntimeError - [!] Xcodeproj doesn't know about the following attributes {"inputFileListPaths"=>[], "outputFileListPaths"=>[]} for the 'PBXShellScriptBuildPhase' isa.
解决办法:打开project.pbxproj文件,删除inputFileListPaths和outputFileListPaths。
重新pod install。