【flutter報錯解決】the following dependencies don't support null safety


使用flutter run后,報如下錯誤:

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

 - package:cloud_firestore_web
 - package:firebase_core_web
 - package:shared_preferences
 - package:url_launcher_web
 - package:firebase_auth
 - package:http
 - package:provider
...

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

第一種方法

在終端運行

flutter run --no-sound-null-safety

第二種方法

IntelliJ/Android Studio

"Edit Configurations" (在RUN配置里) → "Additional run args" 添加

--no-sound-null-safety

VS Code

在用戶設置里查找"Flutter run additional args"並添加

--no-sound-null-safety

參考Stackoverflow解決方案


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM