공부방/Flutter

DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

soycrab 2023. 10. 18. 22:19

mac 과 iOS 업데이트 이후 flutter iOS프로젝트를 실행하면, 

DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead ...

이런 에러가 노출된다. 

그럼 flutter -> ios -> podfile 을 열어서 아래와 같이 내용을 수정해주자 

# post install
post_install do |installer|
  # fix xcode 15 DT_TOOLCHAIN_DIR - remove after fix oficially - https://github.com/CocoaPods/CocoaPods/issues/12065
  installer.aggregate_targets.each do |target|
      target.xcconfigs.each do |variant, xcconfig|
      xcconfig_path = target.client_root + target.xcconfig_relative_path(variant)
      IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
      end
  end

  installer.pods_project.targets.each do |target|
    target.build_configurations.each do |config|
      if config.base_configuration_reference.is_a? Xcodeproj::Project::Object::PBXFileReference
          xcconfig_path = config.base_configuration_reference.real_path
          IO.write(xcconfig_path, IO.read(xcconfig_path).gsub("DT_TOOLCHAIN_DIR", "TOOLCHAIN_DIR"))
      end
    end
  end
end

 

...... 자... 이렇게 까지 수정을했는데 이번에는 오류가 바뀌어따....

Uncategorized (Xcode): Command SwiftDriver emitted errors but did not return a nonzero exit code to indicate failure

Error (Xcode): no such module '__ObjC'

 

그럼 전혀 긴장하지말고 Xcode를 켜고 

아래와 같이 Build Libraries for Distribution을 No로 수정해 보자 !

 

그럼 성공적인 빌드 완료!!

반응형