【问题标题】:ld: truncated fat fileld:截断的胖文件
【发布时间】:2016-08-26 09:21:01
【问题描述】:

我在尝试运行使用 NinevehGL 框架的 XCODE 应用程序时发现了这些错误:

ld: truncated fat file. Slice from 1478656 to 2279616 is past end of file with length 2270604 file './NinevehGL.framework/NinevehGL' for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

我真的不知道是什么问题以及如何解决此类错误我没有找到任何处理此类问题的文档。

【问题讨论】:

  • 你读过this问题/答案吗?
  • 是的,但答案并没有真正帮助

标签: ios compiler-errors


【解决方案1】:

我在我的一个项目中遇到了类似的错误:

ld: truncated fat file. Slice from 1067056 to 2127456 is past end of file with length 770048 file '/Users/jenkins-slave-pepper/workspace/iosbuild/App/Pods/FirebaseInstanceID/Frameworks/FirebaseInstanceID.framework/FirebaseInstanceID' for architecture armv7

解决方案是清除 pod 缓存并重新下载所有内容。

rm -rf ~/Library/Caches/CocoaPods
rm -rf `pwd`/Pods/
pod update

【讨论】:

    【解决方案2】:

    尝试在您的项目中进行以下更改:-

    • 在链接阶段包含所有必要的框架
    • 从其他链接器标志中删除 -all_load
    • 清理构建文件夹并从头开始重新编译。

    This could 很可能是权限问题、损坏的 iOS SDK 安装或损坏的 Xcode 安装。我会删除/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulatorXXX.sdk,然后进入 Xcode > Preferences > Downloads 并重新安装 iOS SDK。然后再次尝试清理并构建您的项目。 如果还是有问题,我会考虑重新安装 Xcode。

    也看看how to fixxcode路径问题。

    【讨论】:

      【解决方案3】:

      我有类似的错误:

      ld: truncated fat file. Slice from *** to *** is past end of file with length *** file '***' for architecture armv7
      

      我的解决方案是放弃我的一个子模块中的更改。

      编辑:

      今天又发生了。这发生在之后,我需要强制重启我的电脑。可能 xCode 或 SourceTree 会更改子模块。

      【讨论】:

        【解决方案4】:

        您是否正在从您自己的 git 存储库中检出这些库?如果是这样,请检查 .gitattributes,因为您可能需要将 *.a(和/或其他)添加到二进制文件列表中。

        在我们的项目中,我们在 Wiki 中维护原始“存档”,直到我们意识到 git 正在“破坏”我们的二进制文件。

        文件的sn-p ...

        #
        ## These files are binary and should be left untouched
        #
        
        # (binary is a macro for -text -diff)
        *.png binary
        *.jpg binary
        *.jpeg binary
        *.gif binary
        *.ico binary
        *.mov binary
        *.mp4 binary
        *.mp3 binary
        *.flv binary
        

        【讨论】:

          【解决方案5】:

          我遇到了类似的错误: ld:截断的胖文件。从 1802240 到 2416332 的切片已超过文件末尾,长度为 1067176 文件“...”用于架构 arm64 clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

          我解决这个问题的方法是从我的 FTP 重新下载框架。下载时可能您的文件不完整。而且我发现一些 FTP 工具可能会得到不同大小的文件。

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 2021-12-29
            • 2010-12-27
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多