VSCode Flutter Debug and Execution given a no-sound-null-safety

huangapple go评论71阅读模式
英文:

VSCode Flutter Debug and Execution given a no-sound-null-safety

问题

Until yesterday everything worked just fine. But for publishing reasons I needed to update my flutter SDK and gradle version, and after that my VsCode debug simply stopped working. It keeps giving me the Could not find an option named "no-sound-null-safety". error.

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on Linux Mint 21.1 5.15.0-76-generic, locale pt_BR.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources

Here's my vsCode.json configs:

After I reopen the VsCode it also gives me this error:

英文:

Until yesterday everything worked just fine. But for publishing reasons I needed to update my flutter SDK and gradle version, and after that my VsCode debug simply stopped working. It keeps giving me the Could not find an option named "no-sound-null-safety". error.

Flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.10.5, on Linux Mint 21.1 5.15.0-76-generic, locale pt_BR.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
[✓] Chrome - develop for the web
[✓] Linux toolchain - develop for Linux desktop
[✓] Android Studio (version 2022.1)
[✓] IntelliJ IDEA Ultimate Edition (version 2022.3)
[✓] VS Code (version 1.79.2)
[✓] Connected device (2 available)
[✓] Network resources

Here's my vsCode.json configs:

VSCode Flutter Debug and Execution given a no-sound-null-safety
VSCode Flutter Debug and Execution given a no-sound-null-safety
VSCode Flutter Debug and Execution given a no-sound-null-safety

After I reopen the VsCode it also gives me this error:

VSCode Flutter Debug and Execution given a no-sound-null-safety

答案1

得分: 1

你正在使用 Flutter 3.10,它使用 Dart 3:

> Dart 3—计划于 2023 年中发布—要求具备空安全性。它将阻止在没有空安全性或具有不安全的空安全性时运行代码。所有现有代码必须迁移到具备空安全性才能与 Dart 3 兼容。要了解更多信息,请参阅 Dart 3 空安全性跟踪问题。

— 不安全的空安全性 | Dart

所以你实际上有两个选项:

  • 迁回 Dart 2,也就是 Flutter 3.7 或更早版本,
  • 将你的代码迁移到具备空安全性。
英文:

You are using Flutter 3.10, which uses Dart 3:

> Dart 3—planned for a mid-2023 release—requires sound null safety. It will prevent code from running without null safety, or with unsound null safety. All existing code must be migrated to sound null safety to be compatible with Dart 3. To learn more, see the Dart 3 sound null safety tracking issue.

— Unsound null safety | Dart

So you have two options really:

  • migrate back to Dart 2, that is Flutter 3.7 or earlier,
  • migrate your code to sound null safety.

huangapple
  • 本文由 发表于 2023年6月29日 21:00:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76581313.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定