Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Error 'DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead' in Xcode 15 beta 5" #12012

Closed
1 task done
CrazyFanFan opened this issue Jul 26, 2023 · 98 comments
Milestone

Comments

@CrazyFanFan
Copy link

Report

What did you do?

Build with Xcode15-beta5 after pod install

What did you expect to happen?

Build success.

What happened instead?

Xcode report error:

DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead (in target 'TARGET' from project 'PROJECT')

CocoaPods Environment

Stack

   CocoaPods : 1.12.1
        Ruby : ruby 3.2.2 (2023-03-30 revision e51014f9c0) +YJIT [arm64-darwin22]
    RubyGems : 3.4.10
        Host : macOS 14.0 (23A5301g)
       Xcode : 15.0 (15A5209g)
         Git : git version 2.41.0
Ruby lib dir : /Users/kkk/.rbenv/versions/3.2.2/lib
Repositories : byted-ee-pods_specs - git - git@code.byted.org:ee/pods_specs.git @ 4654662f2693a5c75747137b9ce9a69ee0336fb1

               byted-ios_library-douyin_binary_repo - git - git@code.byted.org:iOS_Library/douyin_binary_repo.git @ 357091377191269087afeecb2d1288bb79cbc66b

               byted-ios_library-douyin_source_repo - git - git@code.byted.org:iOS_Library/douyin_source_repo.git @ 59efb57b9f2d4806657d87f36dda8c900a099f2c

               byted-ios_library-lark_binary_repo - git - git@code.byted.org:iOS_Library/lark_binary_repo.git @ 1820980a9e885c62345ce4b32bcaf21431f6950f

               byted-ios_library-lark_source_repo - git - git@code.byted.org:iOS_Library/lark_source_repo.git @ cbe896b0a9c9c81ea805a57f89c7444ff78ef924

               byted-ios_library-privatethird_binary_repo - git - git@code.byted.org:iOS_Library/privatethird_binary_repo.git @ 8154f8f18e8b8f6037a00fe561cbd57d478f79be

               byted-ios_library-privatethird_source_repo - git - git@code.byted.org:iOS_Library/privatethird_source_repo.git @ 4bb3b9e87aa1b1e5c44687abeebdb96dc882f55d

               byted-ios_library-publicthird_binary_repo - git - git@code.byted.org:iOS_Library/publicthird_binary_repo.git @ 0d2c930e3f0050f65c9e93bebbfbbb94920f22ab

               byted-ios_library-publicthird_source_repo - git - git@code.byted.org:iOS_Library/publicthird_source_repo.git @ 8231f4396071dd6f36044b63ca1f178e2d5c443c

               byted-ios_library-toutiao_binary_repo - git - git@code.byted.org:iOS_Library/toutiao_binary_repo.git @ 3c358125faa07442cfac67e4e2dcd02ba94bbb28

               byted-ios_library-toutiao_source_repo - git - git@code.byted.org:iOS_Library/toutiao_source_repo.git @ b223d06b6bed4bd96ad7991fc5b010eebd2586a5

               byted-lark-pod_master_fork - git - git@code.byted.org:lark/pod_master_fork.git @ 26ec71f2bf79ac2082f8ad50931b31d4a9fd5f19

               byted-ttvideo-ttvideo-pods - git - git@code.byted.org:TTVideo/ttvideo-pods.git @ 054c0da8067c00dc5dda69b3a8589df908145bca

               byted-ugc-awereleasebinaryspecs - git - git@code.byted.org:ugc/AWEReleaseBinarySpecs.git @ 90e1503bb927b17a0cb3ad57a6e648a41a597c86

               byted-ugc-awespecs - git - git@code.byted.org:ugc/AWESpecs.git @ fbaa37a6995b8c0aea49cae099daf444d65db45f

               byted-ugc-ugcspecs - git - git@code.byted.org:ugc/UGCSpecs.git @ 484065c17166b26193f2fb1a15fb4b8a41c0989e

               trunk - CDN - https://cdn.cocoapods.org/

Installation Source

Executable Path: /Users/kkk/.rbenv/versions/3.2.2/bin/pod

Plugins

cocoapods-deintegrate : 1.0.5
cocoapods-plugins     : 1.0.0
cocoapods-search      : 1.0.1
cocoapods-trunk       : 1.6.0
cocoapods-try         : 1.2.0

Podfile

# Uncomment the next line to define a global platform for your project
 platform :ios, '12.0'

target 'Foo' do
  # Comment the next line if you don't want to use dynamic frameworks
  use_frameworks! :linkage => :dynamic

  # Pods for Foo
  pod 'Sodium', :path => "./Sodium"
end

Project that demonstrates the issue

Foo.zip

@CrazyFanFan
Copy link
Author

This code block is from lib/cocoapods/target/build_settings.rb and triggers an error when a podspec has only dynamically vendored_framework file resource and is marked with a swift_version.

define_build_settings_method :library_search_paths_to_import, :memoized => true do
  search_paths = vendored_static_library_search_paths + vendored_dynamic_library_search_paths
  if target.uses_swift? || other_swift_flags_without_swift?
    search_paths << '/usr/lib/swift'
    search_paths << '${DT_TOOLCHAIN_DIR}/usr/lib/swift/${PLATFORM_NAME}'
    search_paths << '$(PLATFORM_DIR)/Developer/Library/Frameworks' if test_xcconfig?
  end
  return search_paths if target.build_as_framework? || !target.should_build?

  search_paths << target.configuration_build_dir(CONFIGURATION_BUILD_DIR_VARIABLE)
end

@triplef
Copy link

triplef commented Jul 26, 2023

I’m seeing the same issue with out project. Looks like this might prevent building any project using Cocoapods with Xcode 15 beta 3.

@amaurydavid
Copy link

Same issue after moving from Xcode15b4 to Xcode15b5.

@momoraul
Copy link

I have the same issue since xcode15b5.

@marcuswu0814
Copy link
Contributor

Can give this PR a try, and follow this doc to install this version.

@ZhangTonghai
Copy link

`

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

I fix this error with post install hook

@dnkoutso
Copy link
Contributor

done, please bump the submodule as part of this PR and I will run CI to verify this.

@davidemanske
Copy link

thanks @ZhangTonghai, drop that at the bottom of your podfile and then run 'pod install', works!

@Dwarven
Copy link

Dwarven commented Jul 28, 2023

post_install do |installer|
  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

@dnkoutso
Copy link
Contributor

Fixed by #12009

@kekko7072
Copy link

kekko7072 commented Aug 1, 2023

Complete solution for Flutter Developers to add in ios/Podfile:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(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

@Chinmay-KB
Copy link

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

@tylerjames
Copy link

I've tried both solutions from @Dwarven and @ZhangTonghai and (for me) they both result in an error after running pod install

undefined method `real_path' for nil:NilClass

I searched and found this error in previous issues but the solutions there did not work for me (missing xcconfig files, or files referenced in "Recovered References")

This project still installs and builds fine in Beta 4 so I'll go back to that for now.

Does anyone know if the solution in #12009 relies on these posted solutions?

@CrazyFanFan
Copy link
Author

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

This issue is caused by the new ld in Xcode 15. I have been trying to reproduce the problem using open source libraries so that Apple can resolve it as soon as possible. Can you help identify which library is causing the issue?

@Chinmay-KB
Copy link

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

This issue is caused by the new ld in Xcode 15. I have been trying to reproduce the problem using open source libraries so that Apple can resolve it as soon as possible. Can you help identify which library is causing the issue?

I'm unable to figure out what library is causing this

@Kvadroman
Copy link

Any updates? Or better to use beta 4 for now?

@ADiks09
Copy link

ADiks09 commented Aug 2, 2023

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

I'm also receive that error. In my cases I use next libriries

GoogleMLKit/Translate', '3.2.0'
GoogleMLKit/LanguageID', '3.2.0'

Someone known how to fix this issue?

@kekko7072
Copy link

kekko7072 commented Aug 2, 2023

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

I'm also receive that error. In my cases I use next libriries


GoogleMLKit/Translate', '3.2.0'

GoogleMLKit/LanguageID', '3.2.0'

Someone known how to fix this issue?

@ADiks09 Have you tried deleting the pod file.lock and running the following commands:
flutter clean flutter pub get cd ios pod repo update
I have also done them

@Chinmay-KB
Copy link

I tried with this but it throws the same error

@BradenBagby
Copy link

BradenBagby commented Aug 3, 2023

MLKitBarcodeScanning.framework Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp

@kekko7072 I tried out your solution, getting this error Could not build the precompiled application for the device. Error (Xcode): Assertion failed: (fixups().size() == 2), function initFixup, file Atom.cpp, line 2021.

For me it was mobile_scanner package for flutter, which used MLKitBarcodeScanning.framework
Heres the issue on the package: juliansteenbakker/mobile_scanner#690

The workaround mentioned here: juliansteenbakker/mobile_scanner#690 (comment) works

This workaround breaks other frameworks that my main project uses, but Ive verified it fixes this specific problem with a separate flutter project only dependent on mobile_scanner

@CrazyFanFan
Copy link
Author

@BradenBagby Using -ld64 (now updated to -ld-classic) does work because it forces a switch back to the old ld64 linker. However, the issue still persists with the new ld. Here's the explanation of -ld_classic from the man ld:

-ld_classic

Override the choice of linker, and force the use of ld-classic to link the binary. This is incompatible with options such as -merge*, used to build/merge libraries.

@riderx
Copy link

riderx commented Aug 4, 2023

Complete solution for Capacitor Developers to add in ios/Podfile:

post_install do |installer|
  assertDeploymentTarget(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

@shajin-sha
Copy link

Replace this with your PodFile on IOS dir.

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
      
      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

@CrazyFanFan
Copy link
Author

Assertion failed: (fixups().size() == 2)...

This issue has been fixed in Xcode 15-beta6.

@giannigdev
Copy link

giannigdev commented Aug 10, 2023

@CrazyFanFan I have Xcode Beta 6 and the issue is still present with the same error, the solution provided by @ZhangTonghai worked for us

@CrazyFanFan
Copy link
Author

CrazyFanFan commented Aug 10, 2023

@CrazyFanFan I have Xcode Beta 6 and the issue is still present with the same error, the solution provided by @ZhangTonghai worked for us

@giannigdev I apologize for any confusion. In addition to the original question, there is a discussion about another issue related to the new ld error in Xcode 15. The "fix" refers to addressing the problem with LD.

As for the error with 'DT_TOOLCHAIN_DIR,' you can utilize some temporary workarounds mentioned above to bypass it.

It might be a good idea to start a new thread specifically dedicated to discussing the Xcode15(LD)'s problem.

@ravichandra-ayla
Copy link

ravichandra-ayla commented Aug 11, 2023

This issue still present in Xcode 15 beta6.

`rkr@AY-LP-RKR iOS_App % pod install
Ignoring digest-crc-0.6.4 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.4
Ignoring digest-crc-0.6.1 because its extensions are not built. Try: gem pristine digest-crc --version 0.6.1
Ignoring unf_ext-0.0.7.7 because its extensions are not built. Try: gem pristine unf_ext --version 0.0.7.7
Internal Build. Ignoring Release Branches specified in './Release.env'.

Analyzing dependencies
Downloading dependencies
Generating Pods project
[!] An error occurred while processing the post-install hook of the Podfile.

[!] Specifying multiple post_install hooks is unsupported.

/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/podfile/dsl.rb:974:in post_install' /Users/rkr/repos/iOS_App/Podfile:121:in block (2 levels) in from_ruby'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-core-1.12.1/lib/cocoapods-core/podfile.rb:196:in post_install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:1013:in run_podfile_post_install_hook'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:1001:in block in run_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:149:in message'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:1000:in run_podfile_post_install_hooks' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:337:in block (2 levels) in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer/xcode/pods_project_generator/pods_project_writer.rb:61:in write!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:336:in block in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/user_interface.rb:64:in section' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:315:in create_and_save_projects'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:307:in generate_pods_project' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:183:in integrate'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/installer.rb:170:in install!' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/command/install.rb:52:in run'
/Library/Ruby/Gems/2.6.0/gems/claide-1.1.0/lib/claide/command.rb:334:in run' /Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/lib/cocoapods/command.rb:52:in run'
/Library/Ruby/Gems/2.6.0/gems/cocoapods-1.12.1/bin/pod:55:in <top (required)>' /usr/local/bin/pod:23:in load'
/usr/local/bin/pod:23:in <main>'

cbracken added a commit to cbracken/flutter that referenced this issue Sep 26, 2023
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
flutter#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Issue: flutter#133584
Related: flutter#132755
@sorinmiroiu97
Copy link

`

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

I fix this error with post install hook

the same issue happens on xcode 15 release version. this is the working solution. thank you very much @ZhangTonghai.

@luongdong059
Copy link

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

It worked for me. But have this error "Error (Xcode): SDK does not contain 'libarclite' at the path '/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a'; try increasing the minimum deployment target"

@nekrich
Copy link

nekrich commented Sep 28, 2023

Hi.

I see a lot of workarounds for a Podfile here. As a Pod author I want to ask if there is a workaround for the .podspec file, so developers who installs the pod don't not have this error?

@Mar-k
Copy link

Mar-k commented Sep 28, 2023

I am using the following post install hook which also works on the newest Xcode

post_install do |installer|
  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

@paulb777
Copy link
Member

@nekrich As a pod author you can add s.cocoapods_version = '>= 1.13.0' to your podspec to require clients to use at least 1.13.0 or get a failure at installation time.

@reysagar
Copy link

reysagar commented Oct 4, 2023

Still facing this issue, anyone help

`Error (Xcode): type argument 'nw_proxy_config_t' (aka 'struct nw_proxy_config *') is neither an Objective-C object nor a block type
/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator17.0.sdk/System/Library/Frameworks/WebKit.framework/Headers/WKWebsiteDataStore.h:119:46

Parse Issue (Xcode): Could not build module 'WebKit'
/Volumes/Samsung%20T7/@Coding/KB%20FoodNetwork/KB%20Food%20User/build/ios/Debug-iphonesimulator/flutter_inappwebview/flutter_inappwebview.framework/Headers/flutter_inappwebview-Swift.h:893:8

Parse Issue (Xcode): Could not build module 'WebKit'
/Volumes/Samsung%20T7/@Coding/KB%20FoodNetwork/KB%20Food%20User/build/ios/Debug-iphonesimulator/flutter_inappwebview/flutter_inappwebview.framework/Headers/flutter_inappwebview-Swift.h:285:8
`

@Afur
Copy link

Afur commented Oct 4, 2023

@reysagar update flutter_inappwebview plugin to version 5.8.0

It's fixed now: pichillilorenzo/flutter_inappwebview#1790

@reysagar
Copy link

reysagar commented Oct 5, 2023

@Afur version 5.8.0 didn't work for me either,
but I resolved this by adding the below code on the podfile,

Still thank you.

post_integrate do |installer|
  compiler_flags_key = 'COMPILER_FLAGS'
  project_path = 'Pods/Pods.xcodeproj'

  project = Xcodeproj::Project.open(project_path)
  project.targets.each do |target|
    target.build_phases.each do |build_phase|
      if build_phase.is_a?(Xcodeproj::Project::Object::PBXSourcesBuildPhase)
        build_phase.files.each do |file|
          if !file.settings.nil? && file.settings.key?(compiler_flags_key)
            compiler_flags = file.settings[compiler_flags_key]
            file.settings[compiler_flags_key] = compiler_flags.gsub(/-DOS_OBJECT_USE_OBJC=0\s*/, '')
          end
        end
      end
    end
  end
  project.save()
end

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '13.0'
    end
  end
end

Flutter 3.13.1 • channel stable • https://github.com/flutter/flutter.git
Framework • revision e1e47221e8 (6 weeks ago) • 2023-08-22 21:43:18 -0700
Engine • revision b20183e040
Tools • Dart 3.1.0 • DevTools 2.25.0
Cocopods 1.13.0

@Shentia
Copy link

Shentia commented Oct 5, 2023

I am using

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(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

and I got error again but my error is cuz of network image cache and update pubspec.yaml by this line

I am using

cached_network_image:
   git:
     url: https://github.com/gauravmehta13/flutter_cached_network_image.git
     path: cached_network_image

instead of

cached_network_image: ^3.2.3

and my app run perfectly

@Deva-97
Copy link

Deva-97 commented Oct 6, 2023

It helped to solve this problem. Thanks @ZhangTonghai

@kdomingo
Copy link

kdomingo commented Oct 6, 2023

Thanks @ZhangTonghai.

@n13
Copy link

n13 commented Oct 6, 2023

`

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

I fix this error with post install hook

Thanks this worked! Saved me a crazy amount of time, no doubt.

Using CocoaPods 1.13 and XCode 15 this bug is still there as of Oct 2023.

JulianSchroden added a commit to JulianSchroden/cine_remote that referenced this issue Oct 20, 2023
Error message without fix: DT_TOOLCHAIN_DIR cannot be used to evaluate LIBRARY_SEARCH_PATHS, use TOOLCHAIN_DIR instead

Source for the fix: CocoaPods/CocoaPods#12012
@Mammadbayli
Copy link

`

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

I fix this error with post install hook

Thanks this worked! Saved me a crazy amount of time, no doubt.

Using CocoaPods 1.13 and XCode 15 this bug is still there as of Oct 2023.

Yeah issue is happening with 15.0.1, above post install worked.

@therohansanap
Copy link

I was facing same issue but I updated my Cocoapods to 1.14.3 and re-run pod install. My project compiles successfully without adding any post_install fix mentioned above.

@gdh2222
Copy link

gdh2222 commented Nov 29, 2023

I am using 'Sonoma' OS and Xcode 15.0.1.

I updated pod to 1.14.3, but the problem still occurs.

@DevKasun
Copy link

DevKasun commented Dec 3, 2023

This is what I did and it's worked for me

Whenever you update the XCode, you need to update Cocoapods

brew upgrade cocoapods

clean the the installed packages using the command “flutter clean” and install again saving pubspec.yaml file. then on the project folder redirect to the ios folder and install pods again

pod install

That's it.

My Xcode version:
Version 15.0.1 (15A507)

cbracken added a commit to flutter/flutter that referenced this issue Dec 15, 2023
Due to changes in Xcode 15, several variables such as `DT_TOOLCHAIN_DIR`
have been eliminateed in favour of others such as `TOOLCHAIN_DIR`. This
broke CocoaPods support under Xcode 15, as reported in:
CocoaPods/CocoaPods#12012

@vashworth worked around this in Flutter in:
#132803

The CocoaPods issue was resolved by the following PR to their repo:
CocoaPods/CocoaPods#12009
and was released in CocoaPods 1.13.0.

Also switches from an if-else chain to a switch for CocoaPodsStatus
handling.

Related: #133584
Related: #132755

## Pre-launch Checklist

- [X] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [X] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [X] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [X] I signed the [CLA].
- [X] I listed at least one issue that this PR fixes in the description
above.
- [X] I updated/added relevant documentation (doc comments with `///`).
- [X] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [X] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat

Co-authored-by: Greg Spencer <gspencergoog@users.noreply.github.com>
@maojiu-bb
Copy link

`

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

I fix this error with post install hook

is work for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests