'Cannot run with sound null safety, because the following dependencies [build\windows\flutter\flutter_assemble.vcxproj]

I have shifted my entire code to latest dart version 2.15.1. Now I am trying to run the code and it is giving this error.

Image1

Why I am getting this error. Anyone please help me.

Thanks



Solution 1:[1]

This is because some of your dependencies that you are using in your project doesn't support null-safety or Your project itself doesn't support null-safety but using dependencies that supports null-safety. To get rid of this problem you can try upgrading the dependency that is causing the error and if there's no update available for that plugin that run your project using below command :

To Run

flutter run --no-sound-null-safety

To Build

flutter build apk --release --no-sound-null-safety

Solution 2:[2]

This error comes when your project or package is not supported on null safety
when you are trying to run the project its gives you an error which you see in your picture

if you want to run without null safety use this command

flutter run --no-sound-null-safety

when you hit this command on your project it should be run if you face any error kindly comment

Solution 3:[3]

  1. Press Run
  2. Edit Configurations
  3. Add Additional Run args
  4. --no-sound-null-safety

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 MuhammadOmar
Solution 3 Jeremy Caney