Flutter iOS模拟器及真机构建失败:缺失.pcm与.sdkstatcache文件问题求助
Flutter iOS模拟器及真机构建失败:缺失.pcm与.sdkstatcache文件问题求助
我最近在尝试把Flutter App跑在iOS模拟器和真实设备上,但一直卡在构建错误这儿,试了各种方法都没解决,实在没办法来求助了!
具体的错误信息如下:
Command SwiftGeneratePch emitted errors but did not return a nonzero exit code
Error: no such file or directory: Session.modulevalidation
Error: stat cache file 'SDKStatCaches.noindex/iphonesimulator18.1-xxx.sdkstatcache' not found
Error: unable to rename temporary .pcm.tmp → .pcm: No such file or directory
Error: could not build module 'UIKit', 'Foundation', 'CoreGraphics', etc.
Error: failed to emit precompiled header for bridging header
不管是模拟器还是开了开发者模式、连了USB的真实设备,都会报这些错。
我已经试过以下这些排查方法了:
- 执行
flutter clean和flutter pub get - 删除DerivedData和ModuleCache.noindex文件夹
- 重新安装CocoaPods并执行
pod install - 新建了一个空白Flutter项目尝试构建,结果还是一样的错
- 确认Xcode里已经安装了iOS运行时(我装了18.3和18.5版本)
📋 我的系统信息
- MacBook Air M2(Apple Silicon)
- macOS 14.6.1(Sonoma)
- Flutter 3.32.1(稳定版)
- Xcode 16.2
- iOS模拟器:18.3、18.5
- CocoaPods已正常安装
- 开发者模式已开启
有没有大佬能帮我看看怎么解决这个问题啊?
内容来源于stack exchange
相关产品推荐
相关产品推荐

