Xcode build is missing expected TARGET_BUILD_DIR build setting

2,107

I just ran into this and fixed it as follows:

  • run command flutter upgrade
  • run command flutter clean
  • run command flutter pub get if you have missing dependencies
  • attach phone
  • run command flutter run

If it still fails, open the Xcode runner project, set your development team and run it directly from there.

After it runs, close Xcode, do a clean build, and run it using your preferred approach.

Share:
2,107
K'man Amuda Jr.
Author by

K'man Amuda Jr.

Updated on January 01, 2023

Comments

  • K'man Amuda Jr.
    K'man Amuda Jr. over 1 year

    I face error while launching on device on iPhone 12 Pro Max. This is console log

    Launching lib/main.dart on iPhone 12 Pro Max in `debug mode`
    Running Xcode build...
    Xcode build done.                                           270.9s
    Xcode build is missing expected TARGET_BUILD_DIR build setting.
    Could not build the application for the simulator.
    Error launching application on iPhone 12 Pro Max.
    
  • SwiftiSwift
    SwiftiSwift over 2 years
    No need to call flutter upgrade in my case.
  • Mohamed Saheed Mohamed Riswan
    Mohamed Saheed Mohamed Riswan about 2 years
    In my case, After running flutter clean, dependencies were missing so need to run "flutter pub get"
  • brindy
    brindy almost 2 years
    Thanks @MohamedSaheedMohamedRiswan - have added that to the answer