Invalid MinimumOSVersion. App that only support 64-bit devices must specify a deployment target of 8.0 or later

原创文章
声明:作者声明此文章为原创,未经作者同意,请勿转载,若转载,务必注明本站出处,本平台保留追究侵权法律责任的权利。
全栈老韩
全栈工程师,擅长iOS App开发、前端(vue、react、nuxt、小程序&Taro)开发、Flutter、React Native、后端(midwayjs、golang、express、koa)开发、docker容器、seo优化等。

最近在提交iOS app审核时,在最后上传App Connect时,给了我一个报错,提示我的部署target版本无效,但同样的环境,两周前还能正常提交,现在报错了。

在此记录一下。

问题

Upload failed with errors:
The following issues occurred while distributing your application.
Validation failed
Invalid MinimumOSVersion. App that only support 64-bit devices must specify a deployment target of 8.0 or later. MinimumOSVersion in 'xxx.app/Frameworks/App.framework' is ".(ID: ac595c50-225c-4599-8378-5bd5daece418)

问题截图

ios issue png

首先说明一下我的工程是Flutter工程,然后编译为iOS进行的发布。

修复问题

  1. 这个问题,首先确认一下自己的iOS工程中的target的deploy配置是否是正常的,有没有可能由于某些原因发生过变化。
    XCode -> target -> General -> deployment -> version

其实这一步查过了没有什么问题。

  1. 右键你刚刚上传的Archive,显示包内容,在frameworks文件夹下查找App.framework,继续右键查看包内容,找到info.plist文件,查找是否有target deploy的配置。

这一步可能也没有发现什么问题,如果没有找到,那就是证明了这个issue的存在。

  1. 修改Podfile文件 上面的2步只是基础检查,可能并不会有什么帮助,所以我们直接修改Podfile文件,将每一个target都设置deployment target version.

首先,确保顶部的版本设置。

Podfile 复制代码
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

然后在target下针对性的使用module

Podfile 复制代码
target 'Runner' do
  use_frameworks!
  use_modular_headers!  这句
  
  pod 'SwiftyStoreKit'
  
  flutter_install_all_ios_pods File.dirname(File.realpath(__FILE__))
  target 'RunnerTests' do
    inherit! :search_paths
  end
end

最后针对每一个target进行配置deployment target:

terminal 复制代码
...
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['SWIFT_VERSION'] = '5.0'
          config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'  # 这句
...
  1. 删除Podfile.lock文件,方便后续重新pod install

  2. 清理工程

首先clean flutter:

terminal 复制代码
flutter clean
  1. 升级flutter到stable最新版本,防止flutter的版本变化影响。

查看当前flutter的channel:

terminal 复制代码
flutter --version

如果需要切换到stable:

terminal 复制代码
flutter channel stable

升级到stable最新版本

terminal 复制代码
flutter upgrade

然后pub get:

terminal 复制代码
flutter clean
flutter pub get
  1. 编译为iOS
terminal 复制代码
flutter build ios
  1. 重新archive
    通过Xcode打开iOS工程,重新archive。

  2. 上传到App Connect

  3. 无报错。

至此,我的问题已经解决了,欢迎大家一起讨论,请关注我。

暂无评论,快来发表第一条评论吧