解决Flutter下iOS deployment target的问题

minimum deploy target error.

Posted by IOS-MetaNetworks on November 9, 2020
本页面总访问量

Xcode 12.1,iOS 14.1

1. build时出现target error的问题

plugin xxx target is 11.0, but minimum target is 9.0…

不知道是Flutter没考虑到,还是说插件本身可能强制使用了某些target

解决办法:在Podfile尾部加入:

1
2
3
4
5
6
7
8
9
10
11
>platform :ios, '11.0'

...
post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
>   target.build_configurations.each do |config|
>     config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
    end
  end
end

2. iOS虚拟机调试问题

building for iOS simulator, but linking in dylib built for iOS

如果是进行虚拟机调试时,则可以暂时屏蔽相应图片中出现的冲突架构

  1. 进行Excluded Architectures

  1. 搜索VALID_ARCHS,添加x86_64架构