flutter ビルドエラー「Encountered error while archiving for device」と対処方法

2024/11/07に公開

エラー

実行コマンド

flutter build ipa

エラー

Archiving my.app...
Automatically signing iOS for device deployment using specified development team in Xcode project: ***
Running Xcode build...                                                  
 └─Compiling, linking and signing...                         4.7s
Xcode archive done.                                         129.5s
Failed to build iOS app
Error output from Xcode build:
↳
    ** ARCHIVE FAILED **

Xcode's output:
↳
    Writing result bundle at path:
        /var/folders/_z/vs2vk1pj2h3dv27q16_glwtw0000gs/T/flutter_tools.GdBFG7/flutter_ios_build_temp_dir0JMtdS/temporary_xcresult_bundle

    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1461:38: warning: variable 'sum_left' may be uninitialized when used here [-Wconditional-uninitialized]
     1461 |     const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
          |                                      ^~~~~~~~
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1426:3: note: variable 'sum_left' is declared here
     1426 |   uint16x8_t sum_left;
          |   ^
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1461:48: warning: variable 'sum_top' may be uninitialized when used here [-Wconditional-uninitialized]
     1461 |     const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
          |                                                ^~~~~~~
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1425:3: note: variable 'sum_top' is declared here
     1425 |   uint16x8_t sum_top;
          |   ^
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1550:38: warning: variable 'sum_left' may be uninitialized when used here [-Wconditional-uninitialized]
     1550 |     const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
          |                                      ^~~~~~~~
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1509:3: note: variable 'sum_left' is declared here
     1509 |   uint16x8_t sum_left;
          |   ^
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1550:48: warning: variable 'sum_top' may be uninitialized when used here [-Wconditional-uninitialized]
     1550 |     const uint16x8_t sum = vaddq_u16(sum_left, sum_top);
          |                                                ^~~~~~~
    /***/***/***/***/ios/Pods/libwebp/src/dsp/dec_neon.c:1508:3: note: variable 'sum_top' is declared here
     1508 |   uint16x8_t sum_top;
          |   ^
    4 warnings generated.
    /***/***/***/***/ios/Pods/libwebp/src/enc/backward_references_enc.c:724:12: warning: variable 'best_offset' may be uninitialized when used here [-Wconditional-uninitialized]
      724 |           (best_offset << MAX_LENGTH_BITS) | (uint32_t)best_length;
          |            ^~~~~~~~~~~
    /***/***/***/***/ios/Pods/libwebp/src/enc/backward_references_enc.c:656:20: note: initialize the variable 'best_offset' to silence this warning
      656 |     int best_offset;
          |                    ^
          |                     = 0
    1 warning generated.
・・・
// この下にも長々とエラーの続きがありましたが割愛

対処方法

1. Xcodeでbuildしてみる

エラーがでました

2.Xcodeの設定を見直す

下記を参考にしました。
https://github.com/firebase/flutterfire/issues/13342

  1. Xcode => Runner => Build Settings に移動

  2. 「Allow Non-modular Includes In Framework Modules」を「yes」に設定する

    ※「All」を選択すると表示されます。

Discussion