React Native Build Commands Failed: PhaseScriptExecution … (domain=NSPOSIXErrorDomain, code=2)

前端 未结 14 2465
旧巷少年郎
旧巷少年郎 2021-02-12 09:45

Environment

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         


        
相关标签:
14条回答
  • 2021-02-12 10:12

    Adding sudo in front of all commands solves the problem.

    sudo react-native init ProjectName
    
    sudo chmod 777 ProjectName
    
    cd ProjectName
    sudo react-native run-ios 
    
    0 讨论(0)
  • 2021-02-12 10:16

    I fixed my issue, you can try it if you are in the same condition.

    I encountered the same error:

    Print: Entry, ":CFBundleIdentifier", Does Not Exist

    When I clone an existing react-native project from learning react native.

    1. I initialize (using {react-native init yourProjectName}) a new project with the same name in a different directory

    2. copy every useful *.ios.js file to this new project from the one I clone elsewhere.

    This works for me.

    0 讨论(0)
  • 2021-02-12 10:16

    What worked for me was running pod install from the ios directory

    0 讨论(0)
  • 2021-02-12 10:20

    Try running react-native upgrade

    See Github thread: https://github.com/facebook/react-native/issues/7308#issuecomment-219597774

    0 讨论(0)
  • 2021-02-12 10:20

    Edit the file ,ProjectName/node_modules/react-native/local-cli/runIOS/runIOS.js Line no 18 : replace the entire line of code with the following :

    return `build/Build/Products/${configuration}-${isDevice ? 'iphoneos' : 'iphonesimulator'}/${appName}.app`;
    

    Line no: 146: uncomment '-derivedDataPath', 'build',

    after that run the command from the terminal: sudo react-native run-ios

    0 讨论(0)
  • 2021-02-12 10:20

    For me, my problem was that Mcafee is running on port 8081, so I run the app on a different port following this answer https://stackoverflow.com/a/50649969/5323419 Basically:

    react-native run-ios --port 1234 react-native start --port 1234

    I am using React native 0.55+

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