• 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,代码如下:

    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
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

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

     /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)
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7

    解决

    方案一

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

    方案二

    在这里插入图片描述

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

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

    • 在该目录下面查看是否有arc文件夹,如果没有该文件夹,则新建文件夹,命名为arc
    • 将下载好的libarclite_iphonesimulator.a 文件,拷贝到arc 文件夹下面
      在这里插入图片描述
  • 相关阅读:
    C++ STL 用法解释
    hahahaha发到这里吧
    MIPI CSI-2笔记(21) -- JPEG8数据格式
    《进程地址空间》
    用KUSTO查询语句(KQL)在Azure Data Explorer Database上查询LOG实战
    ZKP方案衍变及对比
    面试题-React(十九):React Hook
    酷柚易汛ERP - 系统初始化操作指南
    电子商务、搜索引擎
    力扣刷题记录62.1-----538. 把二叉搜索树转换为累加树
  • 原文地址:https://blog.csdn.net/weixin_36162680/article/details/132806345