xcode_backend.sh: no such file or directory. Do I need to create this file?

25,363

Solution 1

Basically what happens is that one of the project's 'Build Phases' is running a script:

/bin/sh "$FLUTTER_ROOT/packages/flutter_tools/bin/xcode_backend.sh" build

Now in order to find xcode_backend.sh the FLUTTER_ROOT variable needs to be defined. It is defined in a file called Flutter/Generated.xcconfig, which is generated when you run flutter pub get or flutter build.

The build configuration files Debug.xcconfig and Release.xcconfig (in the same Flutter folder) include Generated.xcconfig. Now the only thing left is to ensure that for each of the project configurations these build configuration files are properly set (in XCode under Project > Info > Configuration).

Solution 2

after a lot of messing around, I set these two settings and the build ran on to my physical device.

  • Goto Xcode,

  • click on Runner

  • select Project (top one)

  • go to Info tab

  • change configurations for debug

  • top Runner (green icon) to Generated

  • Bottom Runner (red circles) Pods-Runner-debug

Solution 3

use this settings:

  1. Open Xcode - Click on Runner(Top one)
  2. Select the Runner from "PROJECT" Not from "TARGETS"
  3. Select configuration
  4. And update all the modes as this photo

enter image description here

Solution 4

Open Xcode
Click on Runner(Top one)
Select the Runner from "PROJECT" Not from "TARGETS"
Select configuration
And update all the modes for ex: In debug select "debug" configuration set

enter image description here

Solution 5

By Setting FLUTTER_ROOT as the Flutter sdk path solved this issue for me.

enter image description here

Share:
25,363

Related videos on Youtube

James 666
Author by

James 666

Flutter developer, 2 years and counting...

Updated on April 21, 2022

Comments

  • James 666
    James 666 about 2 years

    My Flutter Project won't run on the ios simulator and is throwing this error:

    Launching lib/main.dart on iPhone Xʀ in debug mode...

    Running Xcode build...

    Xcode build done. 7.6s

    Failed to build iOS app

    Error output from Xcode build:

    ** BUILD FAILED **

    Xcode's output:

    === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Debug ===

    /bin/sh: /Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

    Could not build the application for the simulator.

    Error launching application on iPhone Xʀ.

    The xcode error was also as follows:

    /bin/sh: /Users/pinercode/AndroidStudioProjects/bmi-calculator-flutter/packages/flutter_tools/bin/xcode_backend.sh: No such file or directory

    I've already tried running flutter doctor and there were no errors. I also tried re-rooting my xcode 'FLUTTER_ROOT' and 'FLUTTER_APPLICATION_PATH' in build settings, which did not work.

  • Hanny
    Hanny almost 4 years
    This fixed the problem and it build successfully. However, I had to update my Xcode version to the latest to support the latest version on my iPhone.
  • Abbas
    Abbas almost 3 years
    That's the fix for me. I set project runner to generated and target runner to None.
  • elgsylvain85
    elgsylvain85 over 2 years
    The other and simpler solution was to add this line in the file 'Runner/Flutter/Debug.xcconfig': #include "Generated.xcconfig"
  • Al Walid Ashik
    Al Walid Ashik over 2 years
    i didn't know that :(
  • James Perih
    James Perih over 2 years
    I had changed my flutter path (to support different versions of dart), and this was set to the non-existent path. Set it right, and works great!
  • Ollie
    Ollie over 2 years
    Thank you this solved my issue.
  • Nikesh Nayak
    Nikesh Nayak over 2 years
    Solved my issue also. I was facing same error after upgrading to XCode 13. Thanks a lot. You saved my day.
  • Nazarudin
    Nazarudin over 2 years
    nice one, thanks!
  • Allansrc
    Allansrc over 2 years
    Working fine! thanks
  • Allansrc
    Allansrc over 2 years
    nice! thank you
  • shuster
    shuster about 2 years
    It did not work for me.