💻

[Flutter] fatal error: lipo: can't map input file

2020/07/02に公開

備忘録です。

起こったこと

FlutterでiOS向けの簡単なアプリを作っていたのですが、cloud_firestore を導入したらなんか急に VS Codeから起動 できなくなりました🙄

エラーの全文は以下のとおり。

sent 30769535 bytes  received 188 bytes  61539446.00 bytes/sec
total size is 34965386  speedup is 1.14
building file list ... done
deleting Flutter.framework/_CodeSignature/CodeResources
deleting Flutter.framework/_CodeSignature/
Flutter.framework/
Flutter.framework/Flutter
Flutter.framework/Info.plist
Flutter.framework/icudtl.dat
sent 97123243 bytes  received 92 bytes  194246670.00 bytes/sec
total size is 97111097  speedup is 1.00
/path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/App: signed bundle with Mach-O universal (x86_64 arm64) [io.flutter.flutter.app]
/path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/Flutter.framework/Flutter: signed bundle with Mach-O universal (armv7 x86_64 arm64) [io.flutter.flutter]
2020-07-02 08:53:39.589 defaults[6547:68784]
The domain/default pair of (/path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/Info.plist, CFBundleExecutable) does not exist
fatal error: lipo: can't map input file: /path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
fatal error: lipo: can't map input file: /path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
Failed to extract x86_64 for /path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/. Running lipo -info:
fatal error: lipo: can't map input file: /path/to/project/build/ios/Debug-iphonesimulator/Runner.app/Frameworks/App.framework/flutter_assets/ios/Flutter/App.framework/ (Invalid argument)
Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone SE (2nd generation).
Exited (sigterm)

どうしたら直ったか

  • ビルドのたびに flutter clean する
  • Flutterのバージョンを 1.18.0-8.0.pre に戻す

のどちらかの方法でとりあえず解決できました。

このissue で言及されています。Flutterのバグ?っぽいので、一旦バージョンを戻して使いつつ、直った頃にバージョンを上げようかなと思っています。

ちなみに、一度 flutter clean してVS Codeからデバッグ起動すると、逆に flutter run では起動できなくなります。

その他、故障かな?と思ったときにやること

  • git clean -xdf とかで一旦いろいろなファイルを消してみる
  • VS Codeを再起動してみる
GitHubで編集を提案

Discussion

ログインするとコメントできます