Flutter开发iOS问题记录

一、版本适配问题

warning: The iOS deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 10.0, but the range of supported deployment target versions is 12.0 to 17.2.99. (in target 'Protobuf' from project 'Pods')

可以通过在podfile中配置解决。

yaml 复制代码
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'] = '12.0'
    end
  end
end

二、Build问题

Run script build phase 'Thin Binary' will be run during every build because the option to run the script phase "Based on dependency analysis" is unchecked. (in target 'Runner' from project 'Runner')

可以通过修改build settings设置解决。

三、启动图问题

Flutter启动iOS使用LaunchScreen.storyboard时布局错乱显示出两张不同的启动图,如果使用拖线布局可能会产生此问题;

Flutter在启动时会加载一次闪屏,默认显示与Info.plist中对应的UILaunchStoryboardName。

使用LaunchScreen.storyboard时避免使用Safe Area Layout Guides,Flutter可能会不识别。

四、真机调试问题

在iOS 14+系统真机以调试模式运行App,在断开调试后App无法打开;

原因是Debug模式下,Flutter也实现了热重载,默认编译方式为JIT,而iOS 14+系统对这种编译模式做了限制,导致无法启动;

可以通过更改Xcode编译模式:Xcode使用Release模式编译,这个时候Flutter编译方式为AOT,可正常启动。

不更改Xcode编译模式,更改Flutter编译配置,强制设置为release也可。

相关推荐
OKXLIN41 分钟前
IOS UITextField 无法隐藏键盘问题
ios·objective-c
AL.千灯学长8 小时前
DeepSeek接入Siri(已升级支持苹果手表)完整版硅基流动DeepSeek-R1部署
人工智能·gpt·ios·ai·苹果vision pro
江上清风山间明月1 天前
Flutter开发的应用页面非常多时如何高效管理路由
android·flutter·路由·页面管理·routes·ongenerateroute
openinstall全渠道统计1 天前
免填邀请码工具:赋能六大核心场景,重构App增长新模型
android·ios·harmonyos
Zsnoin能1 天前
flutter国际化、主题配置、视频播放器UI、扫码功能、水波纹问题
flutter
早起的年轻人1 天前
Flutter CupertinoNavigationBar iOS 风格导航栏的组件
flutter·ios
HappyAcmen1 天前
关于Flutter前端面试题及其答案解析
前端·flutter
貂蝉空大1 天前
uni-app开发安卓和ios app 真机调试
android·ios·uni-app
胖虎11 天前
iOS 中的圆角与平滑圆角:从新特性到老项目适配
ios·圆角·平滑圆角·cornercurve
志飞1 天前
ios UICollectionView使用自定义UICollectionViewCell
ios·collectionview·自定义cell