IPHONEOS_DEPLOYMENT_TARGET is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99

Hi,

I'm getting warning in my Swift package where one of external dependency supports from iOS8.0, is it as bug in xcode or do we need to ask 3rd party developer to remove iOS8.0 supports, i believe they need to support library in cocoapods for iOS8.0 as well

Warning:
IPHONEOSDEPLOYMENTTARGET is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99

Forum thread: https://forums.swift.org/t/unable-to-import-multiple-targets-from-external-dependency/39030/3
Post not yet marked as solved Up vote post of kumar.pavan Down vote post of kumar.pavan
80k views

Replies

Code Block
post_install do |installer|
installer.pods_project.targets.each do |target|
target.build_configurations.each do |config|
if Gem::Version.new('8.0') > Gem::Version.new(config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'])
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '8.0'
end
end
end
end



reference

Add a Comment
Is this reply, by utyyyreee, a workaround or a fix?
I have the same issue, although for me it does not pose a problem as it is only affecting tests and those warnings don't actually result in errors down the line (i.e. the code is actually not relying on anything iOS 8.0 specific).

In short: You are correct in your assumption that the problem lies with a dependency further down the line. That means you cannot do much yourself, I believe, as the swift package manager has no means of manipulating that dependency and its settings. In cocoapods you can do that with a snippet similar to the one that utyyyreee posted (without any context... and a typo in lines 4 and 5, where it should say 9.0 and not 8.0... and that only if you want to set it arbitrarily to 9.0...).

That would go into your podfile to manage the project's pod dependencies. Sadly, since it happens in a dependency you yourself only include via the swift package manager, you cannot do it yourself but have to approach the owner of that dependency to make the necessary changes. Or you wait until the underlying dependencies get updated accordingly on their own.

See also this article here for an explanation (no idea why the forum won't let me properly link it, sorry):
Code Block
https://www.jessesquires.com/blog/2020/07/20/xcode-12-drops-support-for-ios-8-fix-for-cocoapods/

Lastly, I assume the pod thing won't help you at all, as the swift package manager probably circumvents that completely (unless they do some weird shenanigans).

After all, the code is not included via pods, but packages.

I, for example, use Telegraph and that simply has the .iOS(.v8) platform defined in its Package.swift file. I will probably contact the author and/or fork the repo to get that to be updated. I don't know whether that then also incrementally updates any dependencies further down the line or whether they also have to be updated in their respective Package.swift files...
You can set the Deployment target for all your Pods references :

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


Or remove the value:

Code Block
post_install do |installer|
 installer.pods_project.targets.each do |target|
  target.build_configurations.each do |config|
   config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
  end
 end
end



  • Thanks, this fix works with iOS 16. I only made a change:

    # --- Fix for iOS 16 --- #   post_install do |installer|    installer.pods_project.targets.each do |target|    target.build_configurations.each do |config|     config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'    end    end   end

    This works too with React Native :)

  • Thanks @jbiscarri. I made a change for iOS 16:

    # --- Fix for iOS 16 --- #   post_install do |installer|    installer.pods_project.targets.each do |target|    target.build_configurations.each do |config|     config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'    end    end   end

    This works too with React Native :)

Add a Comment