Cocoapods: iOS Deployment Target OS Problem

Created on 20 Aug 2020  路  12Comments  路  Source: CocoaPods/CocoaPods

Report

What did you do?

  • (1) pod init , Podfile setting , pod update
  • (2) xcode build

What did you expect to happen?

  • xcode build success

What happened instead?

  • xcode build fail

CocoaPods Environment

Stack

   CocoaPods : 1.10.0.beta.2
        Ruby : ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]
    RubyGems : 3.0.3
        Host : Mac OS X 10.15.6 (19G2021)
       Xcode : 11.6 (11E708)
         Git : git version 2.24.3 (Apple Git-128)
Ruby lib dir : /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib
Repositories : trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /usr/local/bin/pod

Plugins

cocoapods-deintegrate : 1.0.4
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.0
cocoapods-stats       : 1.1.0
cocoapods-trunk       : 1.5.0
cocoapods-try         : 1.2.0

CocoaPods Problem

  • Status

    • My Project - iOS Deployment Target : 8.0
    • Pod Projects - iOS Deployment Target : 8.0
    • Podfile
    • platform :ios, '8.0'
  • Problem

    • iOS Simulator Build, need to iOS Deployment Target Version Change...
    • i want "iOS Deployment Target" not change.
    • ex)

      • "iOS Simulator iPhoneX (11.2)" build case,

      • i must "iOS Deployment Target 11" over setting.. (build able)

Most helpful comment

Add this to your Podfile

# Pods build settings configuration
# optimisations and warning fixes
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Fix for XCode 12
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

All 12 comments

I dont understand the issue. You can use a post install hook to change the deployment target.

Please upload a sample app as well.

I dont understand the issue. You can use a post install hook to change the deployment target.

  • i know, but cocoapods is not make dir, case target os version < Simulator os version

  • case 1 :

    • My Project - iOS Deployment Target : 8.0
      -> not make dirs (FirebaseCore , FirebaseCoreDiagnostics ...)
      -> i want iOS Deployment Target : 8.0 , iOS Simulator iPhoneX (11.2)
      -> pods is not make

ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/FirebaseCore'
ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/FirebaseCoreDiagnostics'
ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/GoogleDataTransport'
ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/GoogleUtilities'
ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/PromisesObjC'
ld: warning: directory not found for option '-F/Users/masteage/Library/Developer/Xcode/DerivedData/TowerDefensePlus-eftgtowlsfrfwpfongodyjyllwvh/Build/Products/Debug-iphonesimulator/nanopb'
ld: framework not found FBLPromises
clang: error: linker command failed with exit code 1 (use -v to see invocation)

  • case 2 :

    • My Project - iOS Deployment Target : 11.0

      -> build success

Add this to your Podfile

# Pods build settings configuration
# optimisations and warning fixes
post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      # Fix for XCode 12
      config.build_settings.delete 'IPHONEOS_DEPLOYMENT_TARGET'
    end
  end
end

thanks @ArtFeel ,
but not fixed....

If I'm understanding this issue correctly, it's that, for Xcode 12, which is now in general release, every pod will issue this warning on compile:

warning: 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. (in target 'IAMenuController' from project 'Pods')

Do I have this right?

If so, it seems to me that, while the post_install workaround is most welcome, it should not be required as SOP, and that this still needs to be fixed.

True?

@claybridges It should be fixed in the podspec's. Fixing in CocoaPods is a potential breaking change. See the discussion at https://github.com/CocoaPods/CocoaPods/issues/9884

Or it should be fixed in Xcode. See the discussion at https://forums.swift.org/t/minimum-ios-version-xcode-12-and-build-warnings/40224

@paulb777 Got it. Thanks for taking the time to explain this.

Shall I close this? Is it the same issue regarding deployment target 8.0 warnings?

Yes. I believe it's the same.

Was this page helpful?
0 / 5 - 0 ratings