close

[Solved] Cannot run with sound null safety, because the following dependencies don’t support null safety

Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track. Cannot run with sound null safety, because the following dependencies don’t support null safety in flutter. So today Here I come with all possible solutions for this error.

We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.

How Cannot run with sound null safety, because the following dependencies don’t support null safety Error Occurs ?

I Have migrated to my app to null safety. Now, I am trying to run it using flutter run, however, it will not start because of the following error:

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

 - package:firebase_messaging
 - package:multi_image_picker
 - package:shared_preferences
 - package:url_launcher_web

...

For solutions, see https://dart.dev/go/unsound-null-safety
Failed to compile application.

How to Solve Cannot run with sound null safety, because the following dependencies don’t support null safety Error?

  1. How to Solve Cannot run with sound null safety, because the following dependencies don't support null safety Error?

    To Solve Cannot run with sound null safety, because the following dependencies don't support null safety Error As per Documentation 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. By running this command your Cannot run with sound null safety, because the following error must be solved. Second solution for VS code users First of all click on File. There You can See Preferences Click on Preferences. Now you can see Settings click on that. Then Just Search For Flutter run additional args then click Add Item now type –no-sound-null-safety click ok Now Your Error must be solved.

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

    To Solve Cannot run with sound null safety, because the following dependencies don't support null safety Error As per Documentation 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. By running this command your Cannot run with sound null safety, because the following error must be solved. Second solution for VS code users First of all click on File. There You can See Preferences Click on Preferences. Now you can see Settings click on that. Then Just Search For Flutter run additional args then click Add Item now type –no-sound-null-safety click ok Now Your Error must be solved.

Solution 1: Run this command

As per Documentation 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

By running this command your Cannot run with sound null safety, because the following this error must be solved.

Solution 2: Setting For Android Studio

To set this up in your IDE of choice, you can use “Edit Configurations” (in your run configurations) → “Additional run args” in IntelliJ and search for “Additional Args” (with “Dart”/”Flutter”) in your setting.

  1. Open Edit Configurations in Run.
  2. Select on Add Additional Run args.
  3. Just add –no-sound-null-safety there.
  4. Apply setting. Press Ok and rerun your app.

Solution 3: Setting for Vs Code Studio

If you are using Vs code then just follow this step.

  1. First of all click on File.
  2. There You can See Preferences Click on Preferences.
  3. Now you can see Settings click on that.
  4. Then Just Search For Flutter run additional args
  5. then click Add Item
  6. now type --no-sound-null-safety
  7. click ok
  8. Now Your Error must be solved.

Here is Image for batter understanding

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

Summery

So, It’s All About This error. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.

Also Check Out Below Tutorials

Leave a Comment

%d bloggers like this: