iOS pod repo push error ld: file not found: libarclite_iphoneos.a problem solution

background

After upgrading Xcode to 14.3, you will receive the following error when running the project in Xcode

File not found: /Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphoneos.a

Compilation errors can be solved in the project through the following methods, which is to set the code in the Podfile IPHONEOS_DEPLOYMENT_TARGETas follows:

post_install do |installer|
    installer.generated_projects.each do |project|
          project.targets.each do |target|
              target.build_configurations.each do |config|
                  config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '12.0'
               end
          end
   end
end

However, because there are some private components in the project and some third-party libraries with relatively low minimum deployment settings are referenced, the following error will be reported when we submit the private components.

 /App-exxigwycpikvlpgzpmccfjpmuvkx/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/YYCategories.build/Objects-normal/x86_64/Binary/YYCategories
    ld: file not found: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/arc/libarclite_iphonesimulator.a
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
 ** BUILD FAILED **
    The following build commands failed:
    	Ld /Users/mengruirui/Library/Developer/Xcode/DerivedData/App-exxigwycpikvlpgzpmccfjpmuvkx/Build/Intermediates.noindex/Pods.build/Release-iphonesimulator/YYCategories.build/Objects-normal/x86_64/Binary/YYCategories normal x86_64 (in target 'YYCategories' from project 'Pods')
    (1 failure)

solve

Option One

Clone the third-party component into the local private repository, modify it minimum deployment, and then rely on our own private component

Option II

Insert image description here

  • Open the application on Mac Finder, find in the menu 前往-> 前往文件夹enter the following address, then go to

/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib

  • arcCheck if there is a folder under the directory . If there is no such folder, create a new folder and name itarc
  • Copy the downloaded libarclite_iphonesimulator.afile to arcthe folder below
    Insert image description here

Guess you like

Origin blog.csdn.net/weixin_36162680/article/details/132806345