[英]Unable to create flutter project
When running flutter create
followed by project name, I receive this error:在运行flutter create
后跟项目名称时,我收到此错误:
Error: Error when reading '../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory
Running "flutter pub get" in pics...
pub get failed (254; Error: Error when reading
'../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No
such file or directory)
I'm trying to create a new flutter project in xcode.我正在尝试在 xcode 中创建一个新的 flutter 项目。 How would I fix this?我将如何解决这个问题?
'../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot': No such file or directory '../documents/flutter/bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot':没有那个文件或目录
It seems like there may be files missing from your Flutter SDK.您的 Flutter SDK 中似乎缺少文件。 There should be a file in the Flutter SDK at bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot
but this error suggests it's missing. Flutter SDK 中的bin/cache/dart-sdk/bin/snapshots/pub.dart.snapshot
应该有一个文件,但是这个错误表明它丢失了。
The easiest fix may be to delete the bin/cache
folder which will cause Flutter to re-download the Dart SDK and other components when you next run flutter
.最简单的解决方法可能是删除bin/cache
文件夹,这将导致 Flutter 在您下次运行flutter
时重新下载 Dart SDK 和其他组件。 This may take a little while depending on your connection, but is the simplest way to ensure the cache
folder is complete.这可能需要一些时间,具体取决于您的连接,但这是确保cache
文件夹完整的最简单方法。 I would suggest closing all IDEs/editors when doing this.我建议在执行此操作时关闭所有 IDE/编辑器。
我有同样的问题,但问题是实时检测 Windows Defender,所以解决方案是关闭它然后创建一个项目......
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.