5
4

More than 3 years have passed since last update.

Flutterでresource fork, Finder information...が出た時の対処

Posted at

はじめに

Flutterでios/Android開発をしている者です。
Flutter run実行するとこんなエラーが出ました

esource fork,Finder information, or similar detritus not allowed
Command CodeSign failed with a nonzero exit code

今回はこれの対処法についてお話します

開発環境

MacOS Catalina -v10.15.5

エラー

Flutter run実行すると
なんかでた

Running Xcode build...                                                  

Xcode build done.                                           69.1s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    app/build/ios/Debug-iphonesimulator/gRPC-C++/gRPCCertificates-Cpp.bundle: replacing existing
    signature
    app/build/ios/Debug-iphonesimulator/gRPC-C++/gRPCCertificates-Cpp.bundle: resource fork,Finder information, or similar detritus not allowed
    Command CodeSign failed with a nonzero exit code
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: Mapping architecture armv7 to i386. Ensure that this target's Architectures and Valid Architectures build settings
    are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
    warning: Mapping architecture arm64 to x86_64. Ensure that this target's Architectures and Valid Architectures build settings
    are configured correctly for the iOS Simulator platform. (in target 'image_picker' from project 'Pods')
Could not build the application for the simulator.
Error launching application on iPhone 8.

Xcodeに関するエラーで、iosに関係しているみたい
初めて見るエラーだったのでresource fork,Finder information, or similar detritus not allowedをググってみる

解決策

ここを参考にして
$ xattr -cr /Users/hoge/app/
$ xattr -lr ios/Runner
を順に実行すると直った

深掘る

解決したのはいいだけど今後のためにコマンドの意味を考える。
まず、xattrとはなんなのか?
これは拡張ファイル属性(extended file attribute:xattr)といいメタデータをユーザがファイルに結びつけることができる機能のこと。
今回の原因はiosのシュミレータファイルの付加情報が壊れている状況だったため、このエラーが表示された模様。

このエラーを解消するために上記のコマンドでディレクトリをクリーンする必要がある。
appの環境構築の際に,ios/Runner/GoogleService-Info.plistを変更したのが原因か?
詳しくはwikiを参照してください

5
4
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
5
4