ios - React Native 构建命令失败 : PhaseScriptExecution . ..(域=NSPOSIXErrorDomain,代码=2)

标签 ios xcode ios-simulator react-native

环境

Mac OS X Version 10.11.3 (15D21)
Xcode Version 7.2 (7C68)
Simulator Version 9.2 (SimulatorApp-643)
react-native-cli 0.1.10
node v5.5.0

我在运行应用程序之前做了什么

npm install -g react-native-cli
react-native init DemoProjectDELETEME
cd ./DemoProjectDELETEME
react-native run-ios

我是 React Native 的新手。当我尝试在 iOS 模拟器上运行默认应用程序时,出现以下错误。我发现了一个类似的问题,但它并没有解决我的问题。

Xcode6 can't run any app in simulator ( Domain = NSPOSIXErrorDomain, Code = 3 )

重启机器和模拟器后问题仍然存在。

** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /Users/x/Desktop/DemoProjectDELETEME/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/DemoProjectDELETEME.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
/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/done.js:10
      throw err;
      ^

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

    at checkExecSyncError (child_process.js:464:13)
    at Object.execFileSync (child_process.js:484:13)
    at _runIOS (runIOS.js:77:34)
    at runIOS.js:24:5
    at tryCallTwo (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/x/Desktop/DemoProjectDELETEME/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/x/Desktop/DemoProjectDELETEME/node_modules/react-native/local-cli/cli.js:86:13)
    at Object.<anonymous> (/usr/local/lib/node_modules/react-native-cli/index.js:73:7)

当我尝试从 Xcode 启动应用程序时遇到跟随者错误。

enter image description here

项目根目录中的

sudo npm start 解决了问题,但是 react-native run-ios 仍然BUILD FAILED

感谢您花时间查看我的问题。

最佳答案

尝试运行 react-native upgrade

参见 Github 线程:https://github.com/facebook/react-native/issues/7308#issuecomment-219597774

关于ios - React Native 构建命令失败 : PhaseScriptExecution . ..(域=NSPOSIXErrorDomain,代码=2),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35243601/

相关文章:

ios - 如何动画化 UILabel Scale 重复

ios - 使用 NSUserdefaults(xcode,swift2) 保存 datePicker 值

iphone - 完成在 iPhone 6.1 模拟器上运行 <App>

iphone - 在设备和模拟器上测试时应用程序的不同行为?

ios - Sprite 套件 | swift 3 | - 无法转换 Void 类型的值(又名“( )' to expected argument type ' unsafeRawPointer”

ios - Storyboard设计时布局属性

ios - CABasicAnimation 在 UIStackView 中不可靠?

ios - 如果我们对同一个 IBOutlet 同时使用 strong 和 retain 会怎样?

ios - 从 plist 中检索数据

ios - xcodebuild 可以自动安装和启动 iOS 模拟器吗?