筆者在運(yùn)行flutter項(xiàng)目到iOS模擬器時(shí)窄坦,遇到如下報(bào)錯(cuò):
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.
如果在當(dāng)前目錄下執(zhí)行
xattr?-rc .
再次運(yùn)行flutter run盏阶,沒什么問題魄眉,當(dāng)再次運(yùn)行的時(shí)候岩梳,又報(bào)同樣的錯(cuò)誤,每次運(yùn)行都執(zhí)行一次?xattr?-rc . 感覺很傻了
完美解決:
1、關(guān)閉Xcode作彤,打開終端:
2浙踢、進(jìn)入DerivedData目錄
cd ~/Library/Developer/Xcode/DerivedData/
3蹬挤、然后再終端執(zhí)行:
xattr -rc .
4、再運(yùn)行flutter項(xiàng)目吨悍,完美解決