How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

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


This content originally appeared on DEV Community and was authored by Herlandro Hermogenes

In Xcode 15, Apple made a modification to the variable that points to the default toolchain location, replacing from $DT_TOOLCHAIN_DIR to $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. This error was on a MacOS v14 (Sonoma), XCode 15.4, Swift 5.0 regarding the Firebase and Firebase Analytics Pods.

Solution:
Add this code to your Podfile

# Solution for: macOS v14 (Sonoma) | XCode 15.4 | Swift 5.0 | PodFile

  post_install do |installer|
  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|

  # Update the Swift version
      config.build_settings['SWIFT_VERSION'] = '5.0'

  # Update all Pods iOS Deployment Target ios Version
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '15.0'

    # Update LIBRARY_SEARCH_PATHS
      ['Firebase.release.xcconfig', 'FirebaseAnalytics.release.xcconfig'].each do |file_name|
        Dir.glob("Pods/**/#{file_name}", File::FNM_CASEFOLD).each do |xcconfig_path|
          text = File.read(xcconfig_path)
          new_contents = text.gsub('DT_TOOLCHAIN_DIR', 'TOOLCHAIN_DIR')
          File.open(xcconfig_path, "w") {|file| file.puts new_contents }
        end
      end

    end
  end
end

and run

pod install


This content originally appeared on DEV Community and was authored by Herlandro Hermogenes


Print Share Comment Cite Upload Translate Updates
APA

Herlandro Hermogenes | Sciencx (2024-10-28T23:17:39+00:00) How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead. Retrieved from https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/

MLA
" » How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead." Herlandro Hermogenes | Sciencx - Monday October 28, 2024, https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/
HARVARD
Herlandro Hermogenes | Sciencx Monday October 28, 2024 » How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead., viewed ,<https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/>
VANCOUVER
Herlandro Hermogenes | Sciencx - » How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/
CHICAGO
" » How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead." Herlandro Hermogenes | Sciencx - Accessed . https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/
IEEE
" » How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead." Herlandro Hermogenes | Sciencx [Online]. Available: https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/. [Accessed: ]
rf:citation
» How to fix the error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead | Herlandro Hermogenes | Sciencx | https://www.scien.cx/2024/10/28/how-to-fix-the-error-dt_toolchain_dir-cannot-be-used-to-evaluate-library_search_paths-use-toolchain_dir-instead/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.