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.

Share