关于flutter:Cannot-run-with-sound-null-safety

flutter sdk 版本升级到2.0或者更高的版本后,运行之前的代码会报错,比方:

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

 - 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。关上Android Studio,而后顺次抉择【Run】 –>【 Edit Configurations】 –> 【Add Additional Run args 】–> 【–no-sound-null-safety】,如下图。

而后,再次运行就没有谬误了。

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理