新的react-native ios应用程序没有构建?

Bal*_*ala 13 macos node.js ios react-native

以下是有关我的环境和构建失败日志的详细信息.任何面临类似问题或知道克服此问题的步骤的人请指出相关步骤或文档.

  • Xcode:7.2.1
  • 节点:v5.9.0
  • npm:3.7.3
  • react-native-cli:0.1.10
  • 反应原生:0.22.2

运行"sudo react-native run-ios"给我留下了下面的日志.

日志:

** BUILD FAILED **


The following build commands failed:
    PhaseScriptExecution Run\ Script /Users/abc/Desktop/REACT-NATIVE/demo/ios/build/Build/Intermediates/React.build/Debug-iphonesimulator/React.build/Script-006B79A01A781F38006873D1.sh
(1 failure)
Installing build/Build/Products/Debug-iphonesimulator/demo.app
No devices are booted.
Print: Entry, ":CFBundleIdentifier", Does Not Exist
/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/done.js:10
      throw err;
      ^

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

    at checkExecSyncError (child_process.js:469:13)
    at Object.execFileSync (child_process.js:489:13)
    at _runIOS (runIOS.js:83:34)
    at runIOS.js:24:5
    at tryCallTwo (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:45:5)
    at doResolve (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:200:13)
    at new Promise (/Users/abc/Desktop/REACT-NATIVE/demo/node_modules/promise/lib/core.js:66:3)
    at Array.runIOS (runIOS.js:23:10)
    at Object.run (/Users/abc/Desktop/REACT-NATIVE/demo/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)
Run Code Online (Sandbox Code Playgroud)

All*_*len 13

别跑:

sudo react-native run-ios
Run Code Online (Sandbox Code Playgroud)

你应该跑:

react-native run-ios
Run Code Online (Sandbox Code Playgroud)

您的root帐户没有正确配置模拟器来运行iOS,因此您在日志中看到"没有设备被启动"错误!


Aru*_*uri 11

我在OS X El Capitan v10.11.4上有类似的问题

node --version v6.0.0
npm --v 3.8.8
react-native-cli: 0.2.0
react-native: 0.24.1
watchman --v 4.4.0
xcode 7.3
Run Code Online (Sandbox Code Playgroud)

我在react-native github上创建了一个问题.

我能够解决我的问题:

对我来说,端口8081正在使用中:

lsof -n -i4TCP:8081

node 7601 arun 23u IPv6 0xc6b249599e5f1169 0t0 TCP *:sunproxyadmin (LISTEN)

所以我按照React Native Troubleshooting中的说明操作并杀死了pid

kill -9 7601

react-native run-ios再次运行命令,一切都按预期工作(在节点6上也是如此).

  • 我能够解决这个问题!对我来说,端口8081正在使用中:`lsof -n -i4TCP:8081``节点7601 CXI624 23u IPv6 0xc6b249599e5f1169 0t0 TCP*:sunproxyadmin(LISTEN)`所以我按照React Native Troubleshooting https://facebook.github中的说明操作. io/react-native/docs/troubleshooting.html`kill - 9 7601`并再次运行命令react-native run-ios,一切按预期工作(在节点6上也是如此). (2认同)
  • 谢谢!考虑使用评论中提供的信息编辑您接受的答案.干杯. (2认同)