3

Xcode 12 drops support for iOS 8 and how to fix deployment target warnings in Co...

 3 years ago
source link: https://www.jessesquires.com/blog/2020/07/20/xcode-12-drops-support-for-ios-8-fix-for-cocoapods/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

20 Jul 2020

software-dev    cocoapods, ios, xcode

The release notes for Xcode 12 beta state that the release “supports on-device debugging for iOS 9 and later, tvOS 9 and later, and watchOS 2 and later.” I am not sure if that means support for building and deploying for iOS 8 is completely removed, but it sounds like it. Who is still deploying to iOS 8, anyway?

If you are using CocoaPods with Xcode 12 beta, then you have probably seen this error:

The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.0.99.

This is happening because support for iOS 8 has been dropped, but the minimum deployment target for the pod is iOS 8. This older GitHub issue on CocoaPods discusses this a bit, as well as this recently opened issue. Note that even if your minimum deployment target is greater than iOS 8, you will still see this error.

Until this is fixed in CocoaPods, you can add the following to your Podfile as a workaround:

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

This will remove all deployment target settings from all of the pods in your project, which allows them to simply inherit the project/workspace deployment target that you have specified at the top of your Podfile.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK