RN初始化项目后执行react-native run-ios,构建失败

错误内容:

Installing build/Build/Products/Debug-iphonesimulator/TestDemo.app
An error was encountered processing the command (domain=NSPOSIXErrorDomain, code=2):
Failed to install the requested application
An application bundle was not found at the provided path.
Provide a valid path to the desired application bundle.
Print: Entry, ":CFBundleIdentifier", Does Not Exist

Command failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/TestDemo.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

解决办法:

RN初始化项目后执行react-native run-ios,构建失败_第1张图片
屏幕快照 2017-08-08 10.39.41.png

修改package.json的react的版本:(如上图)

react版本要和react-native版本搭配,上面版本只换一个也会出错

step: 删除node-modules文件夹,修改pakage.json文件,然后执行npm install即可

第二种办法:(上面的方法对部分用户没有效果)

用--version创建指定版本的项目,
react-native init Demoapp --version 0.44.3  版本号必须精确到两个小数点

备注:我是用的RN最新的版本有问题,不知道原因是啥,大神知道的可以留言解释下,谢谢。

你可能感兴趣的:(RN初始化项目后执行react-native run-ios,构建失败)