ios Apple Mach -O 链接器 (Id) 错误?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45001735/
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
Apple Mach -O Linker (Id) Error?
提问by Brett A
I am trying to build this xcode workspace which was built from Unity. And after modifying the project a little bit when I getting to the very end of building the project (linking) I get the Apple Mach -O Linker (Id) Error. I can't open the error tab to see what exactly is causing the error. All it says is "Linker command failed with exit code 1 (use -v to see invocation). There are also two Apple Mach -O Linker (Id) Errors which occur but I have no idea how to solve them.
我正在尝试构建这个从 Unity 构建的 xcode 工作区。当我在构建项目(链接)的最后阶段稍微修改项目后,我收到 Apple Mach -O Linker (Id) 错误。我无法打开错误选项卡以查看究竟是什么导致了错误。它说的是“链接器命令失败,退出代码为 1(使用 -v 查看调用)。还有两个 Apple Mach -O 链接器(Id)错误发生,但我不知道如何解决它们。
Any help is greatly appreciated!
任何帮助是极大的赞赏!
I can't expand these tabs.. this is all I get toldThis is the warning tab expanded, the two Apple Mach -O Linker (Id) warnings are the same
我无法展开这些选项卡.. 这就是我得到的全部信息这是展开的警告选项卡,两个 Apple Mach -O Linker (Id) 警告是相同的
采纳答案by roy
This problem has different solutions , one of them is to set Enable Bitcodeto No. ( I don't know why by defaultit is Yes)
这个问题有不同的解决方案,其中之一是将Enable Bitcode设置为No。(我不知道为什么默认情况下它是Yes)
This problem is a ghost like problem . Clearing Cache , Restarting Xcode , Simulator and MAC ,Ensuring proper linking of Frameworks ,Changing app Architecture or , Sometimes just doing nothing can solve this problem .
这个问题是鬼一样的问题。清除缓存,重新启动 Xcode,模拟器和 MAC,确保框架的正确链接,更改应用程序架构或,有时什么都不做就可以解决这个问题。
回答by Naloiko Eugene
回答by Yaseen Majeed
For me the scenario was that I removed one of the dependency in my pods which was not required, after removing it I was getting error that the same dependency not found. So I went to delete its entry from the Project>> Build Settings>> other Linker Flagsand then selected the same and deleted it as shown below in the Image. After removing from the linker Flags I started getting the Apple Mach -O Linker (Id) Error?and after trying everything for a day I realised the issue lies inside the linker Flags. Where on deleting any dependecy you have to delete the other line name -framework. you can check the below image to get the clarity.
对我来说,情况是我删除了 pod 中不需要的依赖项之一,删除它后,我收到错误,未找到相同的依赖项。因此,我从Project>> Build Settings>> other Linker Flags 中删除了它的条目,然后选择了相同的条目并将其删除,如下图所示。从链接器标志中删除后,我开始收到Apple Mach -O 链接器 (Id) 错误?在尝试了一天之后,我意识到问题出在链接器标志中。在删除任何依赖项时,您必须删除其他行名称-framework。您可以查看下图以获得清晰度。
So I suggest to keep an eye on it while deleting the dependecy from the linker flags, do delete the associated -framework toowhich lies below the dependency name. In my case it was ObjectMapper
因此,我建议在从链接器标志中删除依赖项时密切关注它,也删除位于依赖项名称下方的关联-framework。就我而言,它是ObjectMapper
回答by Loup G
If you just installed/ uninstalled a pod you might want to look at this. Here's what worked for me:
如果你刚刚安装/卸载了一个 pod,你可能想看看这个。以下是对我有用的内容:
First make sure you are opening the .xcworkspace file not the .xcodeproj. But this is probable not what's causing the issue.
Delete the pod that was recently just installed.
In the project directory on Xcode, open the frameworks folder and if the pod which was just removed is still listed there as one recentlyremovedpod.framework, delete it from there also. This step is what made my project compile eventually.
首先确保您打开的是 .xcworkspace 文件而不是 .xcodeproj。但这很可能不是导致问题的原因。
删除最近刚安装的pod。
在 Xcode 的项目目录中,打开 frameworks 文件夹,如果刚刚删除的 pod 仍然作为一个最近删除的 pod.framework 列在那里,也从那里删除它。这一步是我的项目最终编译的原因。
回答by Mick Byrne
Another possible cause is if you rename one of your targets (why did I do that?) and you're using pods. You end up with a version of your old target name in the Frameworks
folder in your main project (not the Pods project), like pods_oldtarget_framework
which no longer exists.
另一个可能的原因是,如果您重命名了一个目标(我为什么这样做?)并且您正在使用 pod。您最终Frameworks
在主项目(不是 Pods 项目)的文件夹中得到了旧目标名称的版本,就像pods_oldtarget_framework
不再存在一样。
Just delete the old version (or name your target back to it's original and delete the new one), and you should be good to go.
只需删除旧版本(或将您的目标重新命名为原始版本并删除新版本),您就可以开始使用了。
回答by Lukebox
For me it was missing frameworks. Try searching the errors you get on Google and find out which frameworks they're part of, then import them in the Build phases tab.
对我来说,它缺少框架。尝试搜索您在 Google 上遇到的错误并找出它们属于哪些框架,然后将它们导入到构建阶段选项卡中。
回答by Kartik Kanaujia
If building on mac for ios in unity, make sure that in the build settings you disable "Metal Editor Support" under other settings for the ios platform.
如果在 mac 上统一构建 ios,请确保在构建设置中禁用 ios 平台其他设置下的“Metal Editor Support”。
回答by Alex Ilie
I used xcode 9.3 and I got this same error. But with 9.2 it works. The error may happen because of incompatibilities between the artifacts produced by the two xcodes. The project that threw the error included a framework built with xcode 9.2
我使用了 xcode 9.3,但遇到了同样的错误。但是使用 9.2 它可以工作。由于两个 xcode 生成的工件之间不兼容,可能会发生错误。引发错误的项目包括一个用 xcode 9.2 构建的框架
回答by adenizc
I added libstdc++.tbd to "BuildPhases >> Link Binary With Libraries". It works for me.
我将 libstdc++.tbd 添加到“BuildPhases >> Link Binary With Libraries”。这个对我有用。
回答by Peter Ye
I was having the same issue, and resolved by
我遇到了同样的问题,并通过
- installing the latest CocoaPods
- then do
pod setup
- 安装最新的 CocoaPods
- 然后做
pod setup