Ran pod install with this Podfile:
source 'https://cdn.cocoapods.org/'
use_frameworks! :linkage => :static
inhibit_all_warnings!
install! 'cocoapods', :generate_multiple_pod_projects => true
deployment_target = '13.0'
platform :ios, deployment_target
target 'DeploymentTargetTest' do
pod 'SDCAlertView'
end
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
end
end
As you can see, I'm using the post-install hook to set the deployment target, but this does not appear to set it everywhere it's needed:
$ grep -r IPHONEOS_DEPLOYMENT_TARGET Pods
Pods/Pods.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/Pods.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/Pods.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/Pods.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 9.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Pods/SDCAlertView.xcodeproj/project.pbxproj: IPHONEOS_DEPLOYMENT_TARGET = 13.0;
Are there any other post-install actions that are required to update the remaining IPHONEOS_DEPLOYMENT_TARGET settings, which are apparently the ones Xcode is looking at?
Compilation without warnings, all deployment target settings updated to 13.0
I'm seeing a warning to update the project settings for SDCAlertView: "Update the minimum deployment target of project 'SDCAlertView' to '12.0'"
Cocoapods 1.10, Xcode 12.1, running on macOS 10.15.7
You are not changing the projects root object deployment target. You are changing all targets within it.

This could be a tiny bug in cocoapods but workaround is
post_install do |installer|
installer.generated_projects.each do |project|
project.targets.each do |target|
target.build_configurations.each do |config|
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
project.build_configurations.each do |bc|
bc.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = deployment_target
end
end
end
However, this does seem to be a cocoapods bug also as the project we generate should use the same one in Pods.xcodeproj which for some reason it gets the right version.
Ah this may be working as intended actually. The platform of the root object is determined by the pods it includes. In this case SDCAlertView sets its deployment target to 9.0.
So the workaround proposed above is the correct way to fix this and I do not think we should change this logic into CocoaPods.
Closing for now.
Thanks! That workaround is just what I was looking for :)
Thanks a lot! This works for our project!
Most helpful comment
You are not changing the projects root object deployment target. You are changing all targets within it.
This could be a tiny bug in cocoapods but workaround is
However, this does seem to be a cocoapods bug also as the project we generate should use the same one in Pods.xcodeproj which for some reason it gets the right version.