skip to Main Content

I am trying to publish SDK into Cocoa pods.

(pod spec lint –verbose TravelSafelyBoneshell.podspec)

When i run the above command then its showing me below error:

Testing with `xcodebuild`. 
 -> Travel (1.0.29)
    - WARN  | license: Invalid license type.
    - WARN  | [iOS] license: Unable to find a license file
    - ERROR | [iOS] xcodebuild: Returned an unsuccessful exit code.
    - NOTE  | xcodebuild:  note: Using codesigning identity override: -
    - NOTE  | [iOS] xcodebuild:  note: Building targets in dependency order
    - NOTE  | [iOS] xcodebuild:  note: Target dependency graph (3 targets)
    - NOTE  | [iOS] xcodebuild:  error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'Travel' from project 'Pods')

2

Answers


  1. You can use this

    post_install do |installer|
      xcode_base_version = `xcodebuild -version | grep 'Xcode' | awk '{print $2}' | cut -d . -f 1`
    
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          # For xcode 15+ only
          if config.base_configuration_reference && Integer(xcode_base_version) >= 15
            xcconfig_path = config.base_configuration_reference.real_path
            xcconfig = File.read(xcconfig_path)
            xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
            File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
          end
        end
      end
    end
    

    and

    pod install
    

    in terminal

    Login or Signup to reply.
  2. In Xcode 15, Apple made a modification to the variable that points to the default toolchain location, replacing $DT_TOOLCHAIN_DIR with $TOOLCHAIN_DIR. If your project or target relies on the previous variable, you should update it to use $TOOLCHAIN_DIR.

    To perform this replacement, you can add the following code snippet at the end of your project’s Podfile:

    post_install do |installer|
      installer.pods_project.targets.each do |target|
        target.build_configurations.each do |config|
          xcconfig_path = config.base_configuration_reference.real_path
          xcconfig = File.read(xcconfig_path)
          xcconfig_mod = xcconfig.gsub(/DT_TOOLCHAIN_DIR/, "TOOLCHAIN_DIR")
          File.open(xcconfig_path, "w") { |file| file << xcconfig_mod }
        end
      end
    end
    

    After making this change in your Podfile, you will need to install the pods again via the terminal using the command:

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