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

解决办法:

屏幕快照 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最新的版本有问题,不知道原因是啥,大神知道的可以留言解释下,谢谢。

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容