norinoringo / ios-reference-repository

0 stars 1 forks source link

Xcode15でビルド時にDT_TOOLCHAIN_DIRエラーになる #39

Closed norinoringo closed 1 year ago

norinoringo commented 1 year ago

概要

Xcode15にアップデートしたら以下のビルドエラーになった。

対応は以下のIssueを参照 https://github.com/CocoaPods/CocoaPods/issues/12065

TODOリスト

対応

# post install
# Xcode14.3からCocoaPodsでインストールしたライブラリのMinimum DevelopmentsがiOS11未満だとビルドエラーになる
# https://developer.apple.com/forums/thread/728021
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.generated_projects.each do |project|
    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
        config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      end
   end
  end
end

親課題


#

関連課題


備考


norinoringo commented 1 year ago

対応済みなのでCloseする。