记录一次Flutter项目上传App Store Connect出现“Validation failed”错误的问题

491 阅读1分钟

描述

  • Flutter老项目,在flutter3.7之前的版本创建的
  • 现在用Flutter 3.16.9版本适配后,运行iOS都很正常
  • Xcode上 Product -> Archive 打包成功
  • 上传到App Store Connect,在validate环节报错,如下:

企业微信截图_b6551138-9586-4b55-aca0-420e99c9e670.png 错误日志:

...
Invalid Bundle. The bundle Runner.app/Frameworks/App.framework does not support the minimum OS Version specified in the Info.plist.
...

分析

现阶段App Store Connect 要求上传的ipa包的支持的最低系统版本要高于iOS 12.0,应该是项目里的配置或者一些第三方库的支持版本小于12.0了。需要从项目本身和第三方库两个方面着手处理。

处理

  1. 项目支持版本号设置:项目/ios/Podfile文件上面设置 platform :ios, '12.0' image.png

  2. 调整第三方库的支持版本号,同样是修改 项目/ios/Podfile文件 image.png

post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
    end
  end
end

3.修改AppFrameworkInfo.plist文件里的MinimumOSVersion的值,一些老项目MinimumOSVersion的值都小于12.0(本次是有11.0调整为12.0)。 image.png