react-native开发:运行react-native run-ios报错--Print: Entry, ":CFBundleIdentifier", Does Not Exist

情景

在新创建的ReactNative项目,运行命令:react-native init Hello
在项目文件夹下执行react-native run-ios,但是出现以下报错:


Command /bin/sh failed with exit code 1



** BUILD FAILED **



The following build commands failed:
    PhaseScriptExecution Install\ Third\ Party /Users/shixinshan/Development/ReactNativeProjects/Mybaby/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/double-conversion.build/Script-190EE32F1E6A43DE00A8543A.sh
(1 failure)

Installing build/Build/Products/Debug-iphonesimulator/Mybaby.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/Mybaby.app/Info.plist
Print: Entry, ":CFBundleIdentifier", Does Not Exist

原因分析

init命令默认会创建最新的版本,而目前最新的0.45版本需要下载boost库编译。此库体积庞大,在国内即便翻墙也很难下载成功,导致很多人无法正常运行iOS项目,推荐暂时使用0.44.3的版本。

解决方法

创建项目暂时先使用react-native init MyApp –version 0.44.3,指定某个版本。
你可以使用–version参数(注意是两个杠)创建指定版本的项目。例如react-native init MyApp –version 0.44.3。注意版本号必须精确到两个小数点。

参考资料:

React Native开发中遇到的各种问题汇总

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值