简体   繁体   English

Flutter 不能以空安全运行,因为以下依赖不支持空安全

[英]Flutter Cannot run with sound null safety, because the following dependencies don't support null safety

I am new to flutter and I got this error when I tried to run the flutter run command.我是 flutter 的新手,当我尝试运行flutter run命令时遇到了这个错误。 I found many articles related to this issue and got to know that flutter run --no-sound-null-safety is the solution to this issue during development.找了很多关于这个问题的文章,了解到flutter run --no-sound-null-safety是开发过程中解决这个问题的方法。 But my question is that What if I get this error during the production build?但我的问题是,如果我在生产构建期间遇到此错误怎么办? How can I handle it there?我在那里怎么处理?

flutter build <target> --no-sound-null-safety works too (as does flutter test --no-sound-null-safety FYI). flutter build <target> --no-sound-null-safety可以工作(就像flutter test --no-sound-null-safety仅供参考)。

Note that this is a compilation error.请注意,这是一个编译错误。 If it fails, you won't get your APK (or whatever you're targeting), so this is not something you need to worry about happening "in production".如果失败,您将无法获得您的 APK(或您所针对的任何内容),因此您无需担心“生产中”会发生这种情况。

However, if you're new to Flutter, and the project is still young, consider trying to remove the null-unsafe dependencies.但是,如果您是 Flutter 的新手,并且项目还很年轻,请考虑尝试删除 null-unsafe 依赖项。 The command flutter pub outdated --mode=null-safety will give you info on which packages don't support null safety, and whether they can be upgraded.命令flutter pub outdated --mode=null-safety将为您提供有关哪些包不支持空安全以及它们是否可以升级的信息。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全; 在 flutter - Error: Cannot run with sound null safety, because the following dependencies don't support null safety; in flutter 无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全 - Cannot run with sound null safety, because the following dependencies don't support null safety "无法以可靠的 null 安全性运行,因为以下依赖项不支持 null 安全性:" - Cannot run with sound null safety, because the following dependencies don't support null safety: 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全: - Error: Cannot run with sound null safety, because the following dependencies don't support null safety: 无法以声音 null 安全运行,因为依赖项不支持 null 安全 - Cannot run with sound null safety because dependencies don't support null safety 无法正常运行 null 安全,因为以下依赖项 [build\windows\flutter\flutter_assemble.vcxproj] - Cannot run with sound null safety, because the following dependencies [build\windows\flutter\flutter_assemble.vcxproj] Flutter 2.0 以下依赖不支持 null 安全 - Flutter 2.0 following dependencies don't support null safety 错误:无法以声音空安全运行,因为以下依赖项(flutter_absolute_path) - Error: Cannot run with sound null safety, because the following dependencies (flutter_absolute_path) 无法以声音 null 安全运行,因为依赖项不支持 null 安全 - Cannot run with sound null safety because dependencies doesnot support null safety 以下包不支持空安全 - The following packages don't support null safety
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM