[英]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.