Error Running React Native App From Terminal (iOS)

前端 未结 13 2707
借酒劲吻你
借酒劲吻你 2020-12-22 15:43

I am following the tutorial on the official React Native website.

Using the following to build my project:

react-native run-ios

I g

相关标签:
13条回答
  • 2020-12-22 15:59

    In my case the SDKROOT environment variable was wrong, which referred to an old version of iPhoneOSxx.x.sdk. (Perhaps this would have automatically resolved itself after a reboot?)

    You can check by running echo $SDKROOT and verifying that it's a valid path.

    I fixed it by updating in .bash_profile:

    export SDKROOT=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS11.2.sdk
    
    0 讨论(0)
  • 2020-12-22 16:03

    For those like me who come to this page with this problem after updating Xcode but don't have an issue with the location setting, restarting my computer did the trick.

    0 讨论(0)
  • 2020-12-22 16:05

    I had to accept the XCode license after my first install before I could run it. You can run the following to get the license prompt via command line. You have to type agree and confirm as well.

    sudo xcodebuild -license
    
    0 讨论(0)
  • 2020-12-22 16:13

    1) Go to Xcode Preferences

    2) Locate the location tab

    3) Set the Xcode verdion in Given Command Line Tools

    Now, it ll successfully work.

    0 讨论(0)
  • 2020-12-22 16:13

    In Mac: After all, you are getting this issue, there may be a chance of missing the following in System Preferences -> Network -> Ethernet -> Select Advanced -> Proxies

    add the following line,

    *.local,localhost

    0 讨论(0)
  • 2020-12-22 16:15

    By default, after installing Xcode command-line not selected, so open Xcode and go to Preferences >> Locations and set Command Line Tools...

    This worked for me in MAC High Sierra, Xcode Version 9.3:

    Press i to open iOS emulator...

    And You can see a cool new iPhone simulator like below image:

    0 讨论(0)
提交回复
热议问题