简体   繁体   中英

Fresh react-native ios app not building?

Below is the details about my environment and logs of the build failure. Anyone facing similar issue or know steps to overcome this please do point me out to relevant steps or docs.

  • Xcode: 7.2.1
  • Node: v5.9.0
  • npm: 3.7.3
  • react-native-cli: 0.1.10
  • react-native: 0.22.2

Running "sudo react-native run-ios" leaves me with the below logs.

LOGS:

** 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)

do not run:

sudo react-native run-ios

you should run:

react-native run-ios

your root account does not have Simulator configured properly to run the iOS so you see "No devices are booted" error in your log!

I have similar issue on 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

I have created an issue on react-native github .

I was able to resolve my issue:

For me port 8081 was in use :

lsof -n -i4TCP:8081

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

So I followed the instructions from React Native Troubleshooting and killed the pid

kill -9 7601

and ran the command react-native run-ios again and everything worked as expected (on node 6 as well).

Seems you have a wrong path to the Developer directory.

You can check it by running

$ sudo xcode-select -p

Unless you really know what you do, it should points to /Applications/Xcode.app/Contents/Developer .

If that's wrong, try running this command to fix it:

$ sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer

FWIW I was having the exact same problem. However, I was using an older version of Xcode (on Yosemite). I had done a complete reinstall of NVM, NPM, and react-native-cli. Nothing worked . In doing so, I also followed a guide to ensure that node was uninstalled cleanly before I reinstalled.

What eventually worked was upgrading OSX itself to allow installation of the latest XCode (7.3 at this time). Now it works perfectly. I am able to run react-native run-ios from the root directory of my project without the need for sudo . As for the sudo issue you might try making sure you are owner of Projects folder. That helped me as well.

So yeah.. I upgraded to OSX 10.11.4 and XCode 7.3. Worked for me.

Good luck.

不确定这是否相关,但我必须确保我在ruby-2.0.0-p648使用更新的ruby给了我类似的编译问题。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM