Build failed: Could not find an option named "track-widget-creation"

897

Fixed by a amending the xcode_backend.sh file.

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

local track_widget_creation_flag=""
if [[ -n "$TRACK_WIDGET_CREATION" 

&& "${build_mode}" == "debug"

 ]]; then
  track_widget_creation_flag="--track-widget-creation"
fi
Share:
897
yogi
Author by

yogi

Updated on December 10, 2022

Comments

  • yogi
    yogi over 1 year

    I'm trying to build my project to deploy to TestFlight, but my build is failing whether using Xcode, terminal or vscode with the following error: Could not find an option named "track-widget-creation".

    I have followed previous advice to fix this issue and unfortunately it doesn't work for me.

    1. flutter clean
    2. flutter build iOS --release

    Xcode's output: ↳ === BUILD TARGET Runner OF PROJECT Runner WITH CONFIGURATION Release === Could not find an option named "track-widget-creation".

    Run 'flutter -h' (or 'flutter <command> -h') for available flutter commands and options.
    Failed to build /Users/XXXXXX/Documents/Flutter/XXXXXX.
    Command /bin/sh failed with exit code 255