【问题标题】:flutter 'file not found' during build for ios在为 ios 构建期间颤动“找不到文件”
【发布时间】:2020-06-11 05:56:33
【问题描述】:

我正在尝试使用 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 并运行 'flutter pub get'

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

【问题讨论】:

  • flutter clean 有帮助吗?
  • 显然它试图在example 包上使用get,这可能是他们的一个错误。
  • flutter clean 没有帮助。这可能是他们的一个错误。如果您注册该软件包并尝试为 ios 构建,你们看到同样的事情吗?
  • 另外,我运行了flutter build ios并得到:->从.symlinks/plugins/image_picker_web/ios获取image_picker_web的podspec [!]在.symlinks/plugins/image_picker_web/ios中找不到image_picker_web的podspec
  • 很抱歉,我没有 Mac OS 来测试它。

标签: flutter


【解决方案1】:

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

删除所有现有缓存

sudo rm -rf ~/.pub-cache

修复缓存

flutter pub cache repair

重新安装依赖项

flutter packages get

【讨论】:

    猜你喜欢
    • 2019-05-26
    • 2020-06-12
    • 2015-11-24
    • 2021-04-11
    • 2021-12-20
    • 1970-01-01
    • 2022-11-25
    • 2011-03-17
    • 1970-01-01
    相关资源
    最近更新 更多