Error after Xcode 15 update : DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

2023. 9. 20. 15:17Flutter

최근 xcode를 15로 업데이트 한 뒤 build를 하니 해당 에러가 발생되었습니다.

 

 

xcode를 열어 보니, 

 

 

fcm을 사용하는 프로젝트에서 Firebase에 대해 에러가 발생함을 알 수 있었습니다.

 

 

 

 

 

 

제가 해결해본 방법은 

 

1번 

해당 프로젝트 폴더 > ios > Pods > Target Support Files > Firebase이동하여 

 

1. 파일 경로 (안드로이드 스튜디오 에서)

or

 

1. 파일 경로 (Finder 에서)

 

 

 

 

 

 

 

해당 경로 안에 있는 .xcconfig 파일을 다음과 같이 수정해줍니다.

(debug, release 모두 수정하였습니다)

DT_TOOLCHAIN_DIR   >  TOOLCHAIN_DIR

 

성공!

 

 

 

 

 

 

 

2번

 

ios > Podfile   post_install 안에 

  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 }

추가해줍니다.

 

 

예시)

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

 

 

 

 

 

 

1번의 경우 프로젝트 내 에러가 발생한 파일을 직접 수정해준 것이고,

2번의 경우 파일 내 DT_TOOLCHAIN_DIR  가 있다면 TOOLCHAIN_DIR 로 바꿔주는 로직으로 보면 될 것 같습니다.

 

1번과 2번 중 선택하여 해결하시면 될 것 같습니다.

 

 

더보기

이후 업데이트에서 해당 이슈가 해결 될 수 있기에 기록을 위하여 남깁니다. (2023-09-20)

(1번 사용)

 

추가 @@@@

 

cocoapods가 1.13.0 버전이 나오면서 해당 이슈가 해결되었습니다.

cocoapods를 업데이트 해주시고 기존 코드로 다시 원상복구 시키면 됩니다!

 

 

참고 사이트 : https://github.com/CocoaPods/CocoaPods/issues/12012