今天跑一个新的Flutter项目报这个错误:
stat cache file '/Users/superman/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.2-22C146-d5b9239ec3bf5b3adbecdf21472871e3.sdkstatcache' not found
可能跟xcode升级到16.2有关系吧!,flutter运行iOS模拟器出现如下错误

image.png
DerivedData缓存问题,让删除缓存.结果并没有用.
[解决方法]

image.png
然并卵,编译又报各个插件的错误,始终运行不起来。
其实这些都不是真正的错误原因,直接跑安卓,universal_html插件报错如下:
../../../.pub-cache/hosted/pub.flutter-io.cn/universal_html-2.2.2/lib/src/html/dom/element_subclasses.dart:2752:30: Error: The argument type 'String?' can't be assigned to the parameter type 'Object' because 'String?' is nullable and 'Object' isn't.
- 'Object' is from 'dart:core'.
final parsed = css.parse(text);
解决方法:
进入到插件内element_subclasses.dart将2752行改成下面这样:
final text = this.text ?? "";
然后就跑起来了,不知道错误报的也不准,一会报这个插件错误找不到,一会报那个插件的错误。