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 application 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).

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

IDE run arguments/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 Visual Studio 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 Visual Studio Code: search for "Flutter test additional args" in your user settings.

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


In Android Studio:

Run → Edit ConfigurationsAdd Additional Run args--no-sound-null-safety

Enter image description here


If using Visual Studio Code, create file .vscode/launch.json in the project root and 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"
                            ]
                }
        ]
}

If you are using Visual Studio Code, then go to:

  • Menu FilePreferencesSettings

  • Search for "Flutter run additional args"

  • Then click Add Item

  • Now type --no-sound-null-safety

  • Click OK.