在使用React Native最新版0.46.1的时候发现了问题:
Failed to install the requested applicationAn application bundle was not found at the provided path.Provide a valid path to the desired application bundle.Print: Entry, ":CFBundleIdentifier", Does Not ExistCommand failed: /usr/libexec/PlistBuddy -c Print:CFBundleIdentifier build/Build/Products/Debug-iphonesimulator/ReactNativexx.app/Info.plistPrint: Entry, ":CFBundleIdentifier", Does Not Exist
使用各种方法都没有解决
比如react-native upgrade
后面终于找到了原因
node_modules/react-native/ios-install-third-party.sh执行结果不正确,可能是网络原因。
1.放进 ~/.rncache/.
2.解压到node_modules/react-native/third-party/
在xcode中运行,会发现报错,缺少glob config.h
1.进入终端cd node_modules/react-native/third-party/glog-0.3.4
2.运行../../scripts/ios-configure-glog.sh
会发现脚本帮忙生成了很多东西,包括config.h
再次在Xcode运行,就成功了。