flutter|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...
【flutter|flutter run 报错 resource fork, Finder information, or similar detritus not allowed】 ├─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.
如果在当前目录下执行
xattr -rc .
再次运行flutter run,没什么问题,当再次运行的时候,又报同样的错误,每次运行都执行一次 xattr -rc . 感觉很傻了
完美解决:
1、关闭Xcode,打开终端:
2、进入DerivedData目录
cd ~/Library/Developer/Xcode/DerivedData/
3、然后再终端执行:
xattr -rc .
4、再运行flutter项目,完美解决
推荐阅读
- gitlab|gitlab 通过备份还原 admin/runner 500 Internal Server Error
- Flutter的ListView
- 接口|axios接口报错-参数类型错误解决
- iOS|iOS runtime应用整理
- 运用flutter|运用flutter 构建一个发布版(release)APK
- Flutter自定义view|Flutter自定义view —— 闯关进度条
- 打开Anaconda|打开Anaconda Navigator 时报错 error 5 拒绝访问
- 运行报错Cannot|运行报错Cannot find module '@babel/compat-data/corejs3-shipped-proposals’
- iOS开发需要掌握的原理
- Flutter|Flutter SwiftUI React 对比