[Solved] Cannot run with sound null safety Error in Flutter

Are you getting 'Error: Cannot run with sound null safety, because the following dependencies don't support null safety' error while running your app, then have look to solve it.

Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:packagename


* Get more help at https://help.gradle.org

BUILD FAILED in 51s

Run your app with additional '--no-sound-null-safety' args.

flutter run --no-sound-null-safety

Platform target Run command:

flutter run -d chrome --no-sound-null-safety

Add the following line at the top of main.dart file

// @dart=2.9

Go to Settings and find "run additional args".

Copy: --no-sound-null-safety and add into it:

Run your program from "Run Menu".

Click on "main.dart" at top of IDE, and click on "Edit Configuration". Note: You need to add Flutter and Dart plugin on android studio, otherwise this menu is not available. 

Copy: --no-sound-null-safety and add into "additional run args".

Run your app with "Run/Play" Button or from "Run" Menu.

In this way, you can solve "Error: Cannot run with sound null safety, because the following dependencies don't support null safety" error on Flutter project.

No any Comments on this Article


Please Wait...