【问题标题】:Cannot run with sound null safety, because the following dependencies don't support null safety无法以可靠的 null 安全性运行,因为以下依赖项不支持 null 安全性
【发布时间】:2021-05-25 18:08:30
【问题描述】:

/C:/flutter/.pub-cache/hosted/pub.dartlang.org/video_player_platform_interface-2.2.0/lib/messages.dart:4:1:错误:库不能选择退出空安全默认情况下,当使用声音空安全时。 // @dart = 2.8 ^^^^^^^^^^^^^^ /C:/flutter/.pub-cache/hosted/pub.dartlang.org/wakelock_platform_interface-0.1.0+1/lib/messages.dart:4:1:错误:库不能通过以下方式退出空安全性默认,当使用声音空安全时。 // @dart = 2.8 ^^^^^^^^^^^^^^ 错误:无法以健全的空安全性运行,因为以下依赖项 不支持空安全:

嗨,

我从其他人那里导入了项目。当我尝试 pub get it 说 requires SDK version >=2.12.0 然后我通过这个错误更新了它。

解决方案 1:

enter link description here

我已经尝试了上面的链接解决方案仍然通过上面的错误

【问题讨论】:

    标签: flutter dart dart-pub


    【解决方案1】:

    试试这个, 转到终端并运行此命令; flutter run --no-sound-null-safety

    【讨论】:

      【解决方案2】:

      ==> 只需一行 Magic 代码即可构建您的 APK。

      -> open Main file.
      
      -> write this line on the 1st top line.
      
               **" // @dart=2.9 "**
      
      ->  run apk. or build apk
      

      ☻♥ 完成。保留代码。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2021-03-03
        • 2021-09-02
        • 2021-10-23
        • 2021-09-29
        • 2021-11-19
        • 2021-09-18
        • 2021-06-04
        相关资源
        最近更新 更多