Xcode 编译错误:Lipo:无法打开输入文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24967290/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 05:16:55  来源:igfitidea点击:

Xcode Compile Error: Lipo: can't open input file

iosxcode

提问by zicjin

/fatal error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't open input file: /Users/zicjin/Library/Developer/Xcode/DerivedData/Baozou-iOS-gsgjiwiqjwffeheenpeffrqpytqx/Build/Intermediates/Baozou-iOS.build/Debug-iphoneos/Baozou-iOS.build/Objects-normal/armv7/Baozou-iOS (No such file or directory)

/致命错误:/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo:无法打开输入文件:/Users/zicjin/Library/Developer/Xcode/DerivedData/Baozou-iOS -gsgjiwiqjwffeheenpeffrqpytqx/Build/Intermediates/Baozou-iOS.build/Debug-iphoneos/Baozou-iOS.build/Objects-normal/armv7/Baozou-iOS (没有那个文件或目录)

Use virtual machines to compiler does not complain, but switched to the real machine (iphone5s) runtime compilation error will be so enter image description here

用虚拟机编译不报错,但是切换到真机(iphone5s)运行时编译会报错 在此处输入图片说明

the sourcecode on github

github上的源代码

回答by Geet

Set your Build Active Architecture Onlyto YES, then it will work

将您的设置Build Active Architecture Only为 YES,然后它将起作用

回答by YYamil

This happened to me. I'm using a static library in my project and the issue was that I put the aggregate with the universal script as a target instead of using the library itself.

这发生在我身上。我在我的项目中使用了一个静态库,问题是我将具有通用脚本的聚合作为目标而不是使用库本身。

This happens when the universal script tries to generate the universal library but the library itself is not compiled, this script needs the library to be created before running.

当通用脚本尝试生成通用库但库本身未编译时,会发生这种情况,该脚本需要在运行之前创建库。

回答by Moritz

In Xcode 7.2 I had to set Enable Bitcode to No in Build Settings > Build Options.

在 Xcode 7.2 中,我必须在 Build Settings > Build Options 中将 Enable Bitcode 设置为 No。

回答by GhostCode

I ran into this problem while migrating my project from Xcode 5.0.2 to Xcode 6.1. These are the steps that I followed to get it working.

我在将我的项目从 Xcode 5.0.2 迁移到 Xcode 6.1 时遇到了这个问题。这些是我为使其工作而遵循的步骤。

  1. There was a warning generated - "Used recommended settings ... blah blah" - I allowed Xcode to change my project to whatever recommended settings there was.This did not stop the error though.

  2. In TARGET -> BUILD SETTINGS -> BUILD ACTIVE ARCHITECTURES ONLY . I turned the flag to YES.

  3. set TARGET -> BUILD SETTINGS -> Linking -> Other Linker Flags : $(OTHER_LDFLAGS)

  1. 生成了一个警告——“使用了推荐的设置......等等”——我允许 Xcode 将我的项目更改为任何推荐的设置。但这并没有阻止错误。

  2. 在目标 -> 构建设置 -> 仅构建活动架构。我把标志转为“是”。

  3. 设置目标 -> 构建设置 -> 链接 -> 其他链接器标志:$(OTHER_LDFLAGS)

After step 3 -I cleaned and then build my project and Whoa the error just vanished!!!!!

在第 3 步之后 - 我清理并构建了我的项目,哇,错误消失了!!!!!!

回答by Rubens

In your project > Build Phases

在您的项目中 > 构建阶段

Place your lipo run script after CocoaPods scripts, your lipo will run after cocoapods finishes building its frameworks

将您的 lipo 运行脚本放在 CocoaPods 脚本之后,您的 lipo 将在 cocoapods 完成其框架构建后运行

As you can see here

正如你在这里看到的