iOS pod repo push 报错 ld: file not found: libarclite_iphoneos.a 问题解决方案

背景

Xcode 升级 14.3 之后,在Xcode 运行项目会收到以下错误

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

项目中可以通过以下方法解决编译错误,就是在 Podfile 中,设置IPHONEOS_DEPLOYMENT_TARGET,代码如下:

swift 复制代码
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

但是因为项目中有一些私有组件,也引用了一些minimum deployment设置比较低的三方库,会导致我们提交私有组件时,也报如下错误

swift 复制代码
 /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)

解决

方案一

将第三方组件克隆一份放到本地私有仓,修改 minimum deployment,然后依赖我们自己的私有组件

方案二

  • 打开 Mac 上的 Finder 应用程序,在菜单中找到前往 -> 前往文件夹 输入以下地址,然后前往

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

  • 在该目录下面查看是否有arc文件夹,如果没有该文件夹,则新建文件夹,命名为arc

  • 将下载好的libarclite_iphonesimulator.a 文件,拷贝到arc 文件夹下面

相关推荐
xiAo_Ju6 小时前
Xcode 26 Debug view hierarchy 不显示隐藏视图问题
xcode
karshey7 小时前
【IOS webview】h5页面播放视频时,IOS系统显示设置的icon
前端·ios
游戏开发爱好者88 小时前
抓包工具有哪些?代理抓包、数据流抓包、拦截转发工具
android·ios·小程序·https·uni-app·iphone·webview
bybitq9 小时前
Go函数闭包实战-复用函数
ios·golang·xcode
renke336411 小时前
Flutter 2025 跨平台工程体系:从 iOS/Android 到 Web/Desktop,构建真正“一次编写,全端运行”的产品
android·flutter·ios
Zender Han12 小时前
Flutter 中 AbsorbPointer 与 IgnorePointer 的区别与使用场景详解
android·flutter·ios
Digitally15 小时前
3种简单方法备份 iPhone 短信
ios·iphone
2501_9159214315 小时前
Flutter App 到底该怎么测试?如何在 iOS 上进行测试
android·flutter·ios·小程序·uni-app·cocoa·iphone