macos/Pods/Pods.xcodeproj:警告:macOS 部署目标“MACOSX_DEPLOYMENT_TARGET”设置为 10.11 Flutter

问题描述 投票:0回答:1

在 MacOS 上构建 Flutter 应用程序时,我收到以下警告:

/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'nanopb-nanopb_Privacy' from project 'Pods')
/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'nanopb' from project 'Pods')
/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'PromisesObjC-FBLPromises_Privacy' from project 'Pods')
/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.11, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'PromisesObjC' from project 'Pods')
/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'GoogleUtilities-GoogleUtilities_Privacy' from project 'Pods')
/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj: warning: The macOS deployment target 'MACOSX_DEPLOYMENT_TARGET' is set to 10.12, but the range of supported deployment target versions is 10.13 to 13.3.99. (in target 'GoogleUtilities' from project 'Pods')

如果我打开

/Users/fractale/lut_viewer/macos/Pods/Pods.xcodeproj
,我可以将部署目标修改为 10.13,警告就会消失,但在
flutter clean
之后,问题会再次出现。该文件可能已生成。如何解决根本问题?目标的名称不是我直接使用的,但可能是我的依赖项使用的。

flutter build dependencies
1个回答
0
投票

要解决此警告,您必须将 输出依赖项 添加到脚本阶段,或者通过取消选中脚本阶段中的基于依赖项分析将其配置为在每个构建中运行。 (在项目“Runner”的目标“Flutter Assemble”中)

在脚本阶段取消选中基于依赖分析: 导航到 Xcode 中目标的设置:

  1. 在 Xcode 中,打开应用程序的 macos 文件夹中的 Runner.xcworkspace
  2. 要查看汇编设置,请在 Xcode 项目导航器中选择 Runner 项目。然后,在主视图侧栏中,选择 Flutter Assemble 目标。
  3. 选择构建阶段选项卡。
  4. 运行脚本阶段取消选中基于依赖关系分析

运行

flutter clean
,然后运行
flutter pub get
,然后运行
flutter run
,查看警告是否仍然存在。你可能会得到

插件“x”需要比 macOS 更高的最低部署版本 您的应用程序正在定位。

只需增加应用程序的部署目标,如下所述 https://docs.flutter.dev/deployment/macos

需要注意的是,虽然这种方法可以抑制警告,但它可能不是最好的解决方案

© www.soinside.com 2019 - 2024. All rights reserved.