Flutter iOS 清除所有缓存

1、清空 CocoaPods 的所有缓存,这将会清除所有 pod 的缓存,包括已下载的依赖项和 podspec 文件。

$ pod cache clean --all

2、清除 Flutter 缓存: 清除项目中的临时文件、构建缓存和生成的文件。

$ flutter clean

3、清除依赖缓存:清除所有依赖缓存

$ flutter pub cache repair

4、确保 Flutter 项目的所有依赖都被正确拉取

$ flutter pub get

5、删除 Pods 目录并重新安装依赖(仅针对 iOS): 如果项目使用了 iOS 部分,可以手动删除 ios/Pods/ 目录和 ios/Podfile.lock 文件,并重新安装依赖。

$ rm -rf ios/Pods
$ rm ios/Podfile.lock 
$ cd ios
$ pod install
$ cd ..

6、重新运行

$ flutter run