【发布时间】:2022-08-03 00:00:26
【问题描述】:
我正在使用以下命令在 macOS(v12.4 M1 chip) 中构建颤振(v3.0.4) macOS 应用程序:
~/fvm/versions/3.0.4/bin/flutter build macos --release
显示如下错误:
➜ macos git:(main) ✗ ~/fvm/versions/3.0.4/bin/flutter build macos --release --no-tree-shake-icons
Changing current working directory to: /Users/xiaoqiangjiang/source/reddwarf/frontend/tik
???? Building with sound null safety ????
Running pod install... 668ms
--- xcodebuild: WARNING: Using the first of multiple matching destinations:
{ platform:macOS, arch:arm64, id:00006000-001248980AE2801E }
{ platform:macOS, arch:x86_64, id:00006000-001248980AE2801E }
/Users/xiaoqiangjiang/source/reddwarf/frontend/tik/macos/Pods/Pods.xcodeproj: 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 12.3.99. (in target \'FMDB\' from project \'Pods\')
Building macOS application...
我已经将 Pods 和 Runner 部署目标更改为 10.11。我应该怎么做才能更改MACOSX_DEPLOYMENT_TARGET 版本?这是 macOS 的 podfile:
platform :osx, \'10.11\'
# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV[\'COCOAPODS_DISABLE_STATS\'] = \'true\'
project \'Runner\', {
\'Debug\' => :debug,
\'Profile\' => :release,
\'Release\' => :release,
}
def flutter_root
generated_xcode_build_settings_path = File.expand_path(File.join(\'..\', \'Flutter\', \'ephemeral\', \'Flutter-Generated.xcconfig\'), __FILE__)
unless File.exist?(generated_xcode_build_settings_path)
raise \"#{generated_xcode_build_settings_path} must exist. If you\'re running pod install manually, make sure \\\"flutter pub get\\\" is executed first\"
end
File.foreach(generated_xcode_build_settings_path) do |line|
matches = line.match(/FLUTTER_ROOT\\=(.*)/)
return matches[1].strip if matches
end
raise \"FLUTTER_ROOT not found in #{generated_xcode_build_settings_path}. Try deleting Flutter-Generated.xcconfig, then run \\\"flutter pub get\\\"\"
end
require File.expand_path(File.join(\'packages\', \'flutter_tools\', \'bin\', \'podhelper\'), flutter_root)
flutter_macos_podfile_setup
target \'Runner\' do
use_frameworks!
use_modular_headers!
flutter_install_all_macos_pods File.dirname(File.realpath(__FILE__))
end
post_install do |installer|
installer.pods_project.targets.each do |target|
flutter_additional_macos_build_settings(target)
end
end
这是 Pods macOS 部署配置:
我已经尝试清理构建并重建 macOS 应用程序,但仍然无法按预期工作。