flutter run 報錯 resource fork, Finder information, or similar detritus not allowed

筆者在運行flutter項目到iOS模擬器時,遇到如下報錯:

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...

Running Xcode build...? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?


├─Assembling Flutter resources...? ? ? ? ? ? ? ? ? ? ? ? ? 5.1s

└─Compiling, linking and signing...? ? ? ? ? ? ? ? ? ? ? ? 7.6s

Xcode build done.? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 17.4s

Failed to build iOS app

Error output from Xcode build:

?

? ? ** BUILD FAILED **

Xcode's output:

?

? ? /Users/zzz/Desktop/pro/flutter/one/build/ios/Debug-iphonesimulator/Runner.app: resource fork, Finder information, or similar detritus not allowed

? ? Command CodeSign failed with a nonzero exit code

? ? note: Using new build system

? ? note: Planning build

? ? note: Constructing build description

Could not build the application for the simulator.

Error launching application on iPhone 11 Pro Max.


如果在當前目錄下執(zhí)行
xattr?-rc .
再次運行flutter run,沒什么問題,當再次運行的時候,又報同樣的錯誤,每次運行都執(zhí)行一次?xattr?-rc . 感覺很傻了


完美解決:
1、關閉Xcode,打開終端:
2、進入DerivedData目錄

cd ~/Library/Developer/Xcode/DerivedData/

3、然后再終端執(zhí)行:

xattr -rc .

4、再運行flutter項目,完美解決

?著作權歸作者所有,轉載或內(nèi)容合作請聯(lián)系作者
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。