Cannot run with sound null safety because dependencies don't support null safety Cannot run with sound null safety because dependencies don't support null safety flutter flutter

Cannot run with sound null safety because dependencies don't support null safety


First, you should read through the guide to understand unsound null safety.
If you are sure that you want to run your app with unsound null safety, you can use the following command:

flutter run --no-sound-null-safety

The --no-sound-null-safety option is not documented in the article, however, I have not experienced any problems with it for the last few months (and especially not since the whole Flutter framework has been migrated to null safety).

Edit: the documentation has now been updated to include this. See Testing or running mixed-version programs.

IDE run args/configuration

To set this up in your IDE of choice, you can use:

  • In IntelliJ/Android Studio: "Edit Configurations" (in your run configurations) → "Additional run args".
  • In VS Code: search for "Flutter run additional args" in your user settings.

In both cases, add --no-sound-null-safety.

Test configuration

For tests, you will want to do the same thing:

  • In IntelliJ/Android Studio: "Edit Configurations" (in your run configurations) → "Additional args".
  • In VS Code: search for "Flutter test additional args" in your user settings.

In both cases, add --no-sound-null-safety.


In Android Studio:

Run --> Edit Configurations --> Add Additional Run args --> --no-sound-null-safety

enter image description here


If using vscode. create .vscode/launch.json in project rootand add

"args": [         "--no-sound-null-safety"        ]

Complete code:

{        // Use IntelliSense to learn about possible attributes.        // Hover to view descriptions of existing attributes.        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387        "version": "0.2.0",        "configurations": [                {                        "name": "YOUR_PROJECT_NAME",                        "program": "lib/main.dart",                        "request": "launch",                        "type": "dart",                        "args": [                                "--no-sound-null-safety"                            ]                }        ]}