Flutter Xcode 错误未定义符号:_MDFInsetsFlippedHorizo​​ntally 和未定义符号:_MDFRectFlippedHorizo​​ntally

Flutter Xcode Error Undefined symbol: _MDFInsetsFlippedHorizontally and Undefined symbol: _MDFRectFlippedHorizontally

几天来我一直在为这些问题苦苦挣扎。在网上搜索答案仍然无果。

错误详情:

pod 文件列表:(我假设这与 MDFInternationalisation 有关?)

这是我在 podfile 中的代码:

# platform :ios, '9.0'

# 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', '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 Generated.xcconfig, then run flutter pub get"
end

require File.expand_path(File.join('packages', 'flutter_tools', 'bin', 'podhelper'), flutter_root)

flutter_ios_podfile_setup

target 'Runner' do
  use_frameworks!
  use_modular_headers!

  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

我尝试了这个解决方案 https://github.com/material-components/material-components-ios/issues/10203 但错误仍然存​​在。我还尝试安装最新的 xcode 版本。

请帮助我。我已经被困了好几天了,这非常令人沮丧。我是一个 flutter 开发者,所以我是 ios 的菜鸟。希望得到任何指导。谢谢!

在尝试了多种方案后,这是我的方案。只需将此 pod 'MDFInternationalization','~>2.0 添加到您的播客文件中,仅此而已。网上有一些解决方案需要我们改post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) end end 不需要。只需添加 pod md 国际化并确保指定 2.0.

之后,pod install、flutter clean 和 flutter 运行。