简体   繁体   English

使用 --no-sound-null-safety Flutter 生成 App Bundle

[英]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 ,类似于您可以在命令行中执行的操作?

Run

flutter build apk --split-per-abi --no-sound-null-safety

Credit信用

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.

相关问题 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全; 在 flutter - Error: Cannot run with sound null safety, because the following dependencies don't support null safety; in flutter 如何通过 CLI 在 Flutter 中生成签名的应用程序包 - How to generate a signed app bundle in Flutter through CLI Flutter - 错误:此库禁用了空安全功能 - Flutter - Error: Null safety features are disabled for this library Flutter SAML SSO OKTA null 安全集成 - Flutter SAML SSO OKTA null safety integration 当我生成一个 android 应用程序包时它失败了“buildOutput.apkInfo must not be null” - When I generate an android app bundle it fails with "buildOutput.apkInfo must not be null" 在新的 Flutter 版本中强制为空字符串/Json(空安全) - Force Nullable String/Json in New Flutter version (null safety) 从 Android App Bundle 生成通用 APK - Generate Universal APK from Android App Bundle 如何在 React Native 中生成 Android 应用程序包? - How to generate Android app bundle in React Native? 如何使用 jenkins 生成签名的应用程序包? - How to generate signed app bundle using jenkins? 如何在flutter上使用android的app bundle? - How to use app bundle of android on flutter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM