##はじめに
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を参照してください