ARTICLE

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

Original Artikel
Erklärung: Der Autor erklärt, dass dieses Artikel ursprünglich ist, ohne Zustimmung des Autors, nicht neu veröffentlicht, wenn neu veröffentlicht wird, muss diese Website anzeigen, und die Plattform behält sich das Recht vor, die gesetzliche Verantwortung für Verstöße zu verfolgen.

最近在提交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 Copy
# Uncomment this line to define a global platform for your project
platform :ios, '13.0'

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

Podfile Copy
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 Copy
...
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 Copy
flutter clean
  1. 升级flutter到stable最新版本,防止flutter的版本变化影响。

查看当前flutter的channel:

terminal Copy
flutter --version

如果需要切换到stable:

terminal Copy
flutter channel stable

升级到stable最新版本

terminal Copy
flutter upgrade

然后pub get:

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

  2. 上传到App Connect

  3. 无报错。

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

Schreiben Sie Ihre Gedanken
Meinungen zu teilen, freundliche Kommunikation
Bitte bleiben Sie freundlich und vernünftig diskutiert
0 Worte

Keine Kommentare, erstmals kommentieren.