I have this error when I try to debbug my app, I used to debbug my app with no sound null safety, I update flutter and it doesnt work now, how can I resolve it?
7 Answers
Had this issue, I couldn't even run a new project built with Flutter 3.10 itself.
I use VSCode so all I had to do, is to the settings and search for Additional, check you'll find this.
and also had to go into settings.json and remove another flag related to null safety,
Now I can build with no problem!
As of Dart 3.0 there is no support for no sound null safety. You can do flutter downgrade
to go back to the last version you had. But I really suggest you try and get your code up to date to null safety since it helps a lot while coding.
If you are using android studio, go configurations, and delete the arg "no-sound-null-safety".
You might need to run flutter pub upgrade --major-versions, to upgrade all packages, and after that, you might need to amend the code, to make it work with the latest dart, flutter sdk, and packages breaking changes. Some things might be deprecated, or removed at all. If you have an error on a class name, you have to see from which package it was, and go to readme or changelog sections and see the breaking changes for that package.
--no-sound-null-safety
this is view my flutter < 3.10 version.
it's could be fix it on change your setting.
Go to VScode setting now search in flutter run add now you view
Change to ->
Go to vs code setting and find Flutter Additional Args
then remove added -no-sound-null-safety then its working
In my case, I solved this issue by simply running these commands
flutter pub upgrade --major-versions
flutter clean
flutter pub get
and run it
flutter run
In my case I did not remove --no-sound-null-safety in run->edit configurations->additional run args:
1- Go to main.dart > Edit Configurations... (LOOK TO IMAGE)
2- delete (no-sound-null-safety") in Additional run args: field
RUN YOUR PROJECT ... PROBLEM SOLVED