已解決 : Error: Cannot run with sound null safety, because the following dependencies


flutter sdk 版本升級到2.0或者更高的版本后就發現運行時會報錯:

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

 - package:loading_indicator_view
 - package:flutter_swiper
 - package:flutter_page_indicator
 - package:transformer_page_view

For solutions, see https://dart.dev/go/unsound-null-safety


FAILURE: Build failed with an exception.

也就是說以上有些包不支持 safety模式。

解決方案:--no-sound-null-safety

  • run
    flutter run --no-sound-null-safety
  • build
    flutter build apk --no-sound-null-safety

這里還有更多方式


免責聲明!

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



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