在构建 iOS 期间颤振'file not found'



我正在尝试使用image_picker_web包,(https://pub.dev/packages/image_picker_web(并放置:

image_picker_web: ^1.0.9 

在我的 pubspec.yaml 文件中。

当我尝试为 iOS 构建项目时,出现以下错误:

[ios/.symlinks/plugins/image_picker_web/example] flutter pub get
Running "flutter pub get" in example...                         
Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2)
pub get failed (66; Cannot open file, path = '/Users/username/.pub-cache/global_packages/image_picker_web_example/pubspec.lock' (OS Error: No such file or directory, errno = 2))
exit code 66

由于项目中没有使用该包的其他代码,我收到相同的错误。避免它的唯一方法是在我的 pubspec.yaml 中注释掉image_picker_web:^1.0.9 并运行"颤振酒吧获取">

我在他们的 git 存储库中创建了一个问题,假设这是一个错误。 是这样吗?有什么解决方法吗?(也许在为不同平台构建时忽略包?

我运行以下命令来解决类似的问题。

删除所有现有缓存

sudo rm -rf ~/.pub-cache

修复缓存

flutter pub cache repair

重新安装依赖项

flutter packages get

最新更新