今天跑一個(gè)新的Flutter項(xiàng)目報(bào)這個(gè)錯(cuò)誤:
stat cache file '/Users/superman/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphoneos18.2-22C146-d5b9239ec3bf5b3adbecdf21472871e3.sdkstatcache' not found
可能跟xcode升級(jí)到16.2有關(guān)系吧!,flutter運(yùn)行iOS模擬器出現(xiàn)如下錯(cuò)誤

DerivedData緩存問題,讓刪除緩存.結(jié)果并沒有用.
[解決方法]

然并卵,編譯又報(bào)各個(gè)插件的錯(cuò)誤,始終運(yùn)行不起來。
其實(shí)這些都不是真正的錯(cuò)誤原因,直接跑安卓,universal_html插件報(bào)錯(cuò)如下:
../../../.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);
解決方法:
進(jìn)入到插件內(nèi)element_subclasses.dart將2752行改成下面這樣:
final text = this.text ?? "";
然后就跑起來了,不知道錯(cuò)誤報(bào)的也不準(zhǔn),一會(huì)報(bào)這個(gè)插件錯(cuò)誤找不到,一會(huì)報(bào)那個(gè)插件的錯(cuò)誤。