2023年10月18日 星期三

[iOS][Swift][App] Xcode 15 and iOS 17 Error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

Error message

升級到 iOS 17 後,也得升級到 Xcode 15 才能使用了,但原本的 project 卻無法 build 了,遇到的就是上圖的 error,以下是解決方法

  • 請確保 xcode-select -p 有選在正確的 Xcode 15 路徑上
  • brew upgrade cocoapods
    • 若不是使用 brew 的話請使用下面
      • gem update cocoapods
  • Delete Pod directory in your App(if present)
  • pod install
  • pod repo update
  • pod install
  • Clean project 且重 build

Reference

  1. Xcode 15 and iOS 17 - Error: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead #12065 (link)