skip to Main Content

Whenever I install a new pod project, and for example I install firebase libraries I always get installed libraries to be targeted for projects 8.0 or and I start changing them manually to be 9.0 or 14.0 because of the warning that I’m Getting.

Warning Errors

Here it is the Podfile content:

 platform :ios, '14.0'

target 'TestProject' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks!

  # Pods for TestProject

        pod 'SDWebImageSwiftUI'
        pod 'lottie-ios'
        pod 'Firebase/Auth'
        pod 'Firebase/Firestore'
end

How it is possible to update target iOS all at once, so I won’t be updating all the libraries one by one?

2

Answers


  1. Add this to your Podfile and then pod install.

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

    This will update all the Pod targets at once to your desired version.

    Login or Signup to reply.
  2. Depending on your Podfile, Warren’s answer might not be enough to set all targets to the new deployment target. I recommend using this post-install handler:

    deployment_target = '14.0'
    
    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
    

    This addition becomes important when you use options like install! 'cocoapods', :generate_multiple_pod_projects => true

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search