【问题标题】:Macosx Deployment target firestore/firebase_coreMacos 部署目标 firestore/firebase_core
【发布时间】:2021-07-14 04:43:08
【问题描述】:

您好,当我运行包含 firestore/firebase_core 的 Flutter 代码时出现此错误 我尝试了多个部署目标,但仍然出现错误

Launching lib/main.dart on macOS in debug mode...
Building macOS application...
Error: Cannot run with sound null safety, because the following dependencies
don't support null safety:

 - package:firebase_core
 - package:firebase_core_platform_interface
 - package:quiver
 - package:plugin_platform_interface
 - package:cloud_firestore
 - package:cloud_firestore_platform_interface

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

Command PhaseScriptExecution failed with a nonzero exit code
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Constructing build description
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'BoringSSL-GRPC' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.6, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'nanopb' from project 'Pods')
warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.7, but the range of supported deployment target versions is 10.9 to 11.0.99. (in target 'leveldb-library' from project 'Pods')
** BUILD FAILED **

Exception: Build process failed

【问题讨论】:

    标签: xcode firebase flutter google-cloud-firestore deployment-target


    【解决方案1】:

    发生此错误是因为您尝试使用不支持 null 安全性的库来运行您的应用程序。您可以通过使用以下命令运行您的应用程序来解决此问题:

    flutter run --no-sound-null-safety

    如果您使用的是 IDE,则需要更改运行配置,例如在 VSCode 中:

    Code => Preferences => Settings => 搜索设置,输入“flutter test” => Dart: Flutter Test Additional Args, Add item => Add "--no-sound-null-safety

    我建议您查看this 链接以了解如何更好地理解此错误。

    【讨论】:

      猜你喜欢
      • 2018-03-17
      • 1970-01-01
      • 2011-10-29
      • 2018-03-30
      • 1970-01-01
      • 2020-10-16
      • 2011-08-03
      • 2011-08-01
      • 1970-01-01
      相关资源
      最近更新 更多