LoginSignup
0
1

More than 5 years have passed since last update.

FlutterのiOSビルド時にtrack-widget-creationオプションが見つからないエラーが出る

Last updated at Posted at 2019-01-30

環境情報

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, v1.0.0, on Mac OS X 10.14 18A391, locale ja-JP)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] iOS toolchain - develop for iOS devices (Xcode 10.1)
[✓] Android Studio (version 3.2)
[✓] IntelliJ IDEA Community Edition (version 2018.3.2)
[✓] Connected device (2 available)

問題

FlutterアプリのiOSビルドを行うと下記エラーが発生する。

$ 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 xxx.
    Command /bin/sh failed with exit code 255

解決方法

Flutterのxcode_backend.shを編集する。
(track-widget-creationオプションを付けないようにする)
なんか根本的な解決方法になってないと思うので、CIでのビルドでコケたら追記します。

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

local track_widget_creation_flag=""
if [[ -n "$TRACK_WIDGET_CREATION" ]]; then
  # track_widget_creation_flag="--track-widget-creation"
  track_widget_creation_flag=""
fi

追記:
Release.xcconfigにTRACK_WIDGET_CREATION=を追記する方が正しそうです。

$ vi $PROJECT_ROOT/ios/Flutter/Release.xcconfig

TRACK_WIDGET_CREATION=// 追記

参考

https://github.com/flutter/flutter/issues/24239
https://wapa5pow.com/flutter-ci-cd/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1