[英]Generate App Bundle with --no-sound-null-safety Flutter
I am trying to generate the App Bundle via Android studio (Build -> Generate Signed Bundle / APK), and I am running into an error when building a bundle.我正在尝试通过 Android 工作室(Build -> Generate Signed Bundle / APK)生成 App Bundle,并且在构建包时遇到错误。
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety
Is there a way that I can add the argument --no-sound-null-safety
, similar to what you can do in the command line?有没有一种方法可以添加参数--no-sound-null-safety
,类似于您可以在命令行中执行的操作?
Disable sound null safety using the --no-sound-null-safety flag to the dart or flutter command:使用 dart 或 flutter 命令的 --no-sound-null-safety 标志禁用声音 null 安全:
dart --no-sound-null-safety run
flutter build apk --split-per-abi --no-sound-null-safety
Alternatively, set the language version in the entrypoint — the file that contains main() function — to 2.9或者,将入口点(包含 main() function 的文件)中的语言版本设置为 2.9
// @dart=2.9
import 'src/my_app.dart';
main() {
//...
}
run:
flutter build appbundle --no-sound-null-safety
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.