Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety. // @dart = 2.8 ^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:4:1: Error: A library can't opt out of null safety by default, when using sound null safety. // @dart = 2.8 ^^^^^^^^^^^^^^ Error: Cannot run with sound null safety, because the following dependencies don't support null safety:

Hi,

I imported project from other person. When I try pub get it say requires SDK version >=2.12.0 <3.0.0, version solving failed. Then i Updated dart it through this error.

Solution 1:

enter link description here

I have tried above link solution still throughs this above error

like image 417
siva Avatar asked Sep 14 '25 13:09

siva


2 Answers

Try this, Go to terminal and run this command; flutter run --no-sound-null-safety

like image 157
Mr. Ripper Avatar answered Sep 16 '25 07:09

Mr. Ripper


Only one line Magic code can Build your APK.

-> open Main file.

-> write this line on the 1st top line.

     **" // @dart=2.9 "**

-> run apk. or build apk

like image 32
Nikhil S Marathe Avatar answered Sep 16 '25 08:09

Nikhil S Marathe