RN初始化项目后执行react-native run-ios,构
2017-08-08 本文已影响57人
这个熊孩子不太冷
错误内容:
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 版本号必须精确到两个小数点