Xcode分发应用程序失败错误:“找到意外的Mach-O标头代码”。使用迦太基
应用程序构建并运行没有任何问题。我可以存档该应用程序,但当我尝试分发进行测试时,出现错误: “发现意外的 mach-o 标头代码:0x0987654”
当我深入控制台时转储时,我注意到警告,我认为它们与我的问题有关:
Class PLCrashReportMachExceptionInfo 在 /private/var/containers/Bundle/Application/xxx/Foo.app/Frameworks/DatadogCrashReporting.framework/DatadogCrashReporting 和 / 中实现var/containers/Bundle/Application/xxx/Foo.app/ 将使用两者之一。哪个是未定义的。
我最近集成了 RumSDK,当我从我的应用程序中删除 RumSDK.xcframeworks 时,我没有收到任何错误,一切都解决了,但 Rum SDK 是一个动态库,需要嵌入到应用程序中。当我不嵌入它时,应用程序将崩溃,因为链接器找不到源。它有许多依赖项,我假设其中一些(例如 DatadogCrashReporting.framework)是嵌套依赖项。 如果有人能帮助我摆脱痛苦,我将非常感激。
我的问题与此非常相似: Xcode - 发现意外的 Mach-O 标头代码: 0x72613c21 - 嵌入式API
我尝试了很多事情,其中多次清理build文件夹和driveddata文件夹并更新carthage ...所以请不要给我这些简单的答案。
我已经搜索了很多小时来找到这些问题的解决方案,可可豆荚有很多解决方案可以从捆绑包中删除嵌套/重复的框架,但是我使用迦太基,但我没有看到使用迦太基解决此问题的任何解决方案。
以下是我搜索的解决方案的示例: 两者都实现了类,将使用两者之一。哪一个未定义
Foo 类在 MyApp 和 MyAppTestCase 中均实现。将使用两者之一。哪一个未定义
找到一个意外的 Mach-O 标头代码:Xcode 7 中的 0x72613c21
提交到 AppStore:发现意外的 Mach-O 标头代码: 0x72613c21
我还有另一个控制台日志:
malloc: nano zone abandoned due to inability to preallocate reserved vm space.
但我无法解决这个问题,不知道它们是否是相关与否。
App builds and runs without any problem. I Can archive the app but when I try to distribute for testing I get error: "Found an unexpected mach-o header code: 0x0987654"
When I digged deep in the console dump, I noticed warnings that I assume they are related to my problem:
Class PLCrashReportMachExceptionInfo is implemented in both /private/var/containers/Bundle/Application/xxx/Foo.app/Frameworks/DatadogCrashReporting.framework/DatadogCrashReporting and /var/containers/Bundle/Application/xxx/Foo.app/ One of the two will be used. Which one is undefined.
I have recently integrated RumSDK and when I remove RumSDK.xcframeworks from my app I dont get any errors and everything is solved, but Rum SDK is a dynamic library that needs to be embeded into the app. When I dont embed it app will crash because linker cant find the source. It has many dependencies that I assume some of them like DatadogCrashReporting.framework are nested dependencies.
If any one can help me get out of misery I would really appreciate it.
my problem is very simmilar to this one:
Xcode - Found an unexpected Mach-O header code: 0x72613c21 - Embedded API
I have tried many things, among them many times of cleaning build folder and driveddata folder and updating carthage ... so please dont give me these simple answers.
I have searched many hours to find a solution for these problems, there are many solutions for cocoa pod to remove the nested/duplicated frameworks from the bundle, however I use carthage and I dont see any solutions for this problem using carthage.
Here are the examples of the solutions that I searched for:
Class is implemented in both, One of the two will be used. Which one is undefined
Found an unexpected Mach-O header code: 0x72613c21 in Xcode 7
Submitting to AppStore: Found an unexpected Mach-O header code: 0x72613c21
I also have another concole log:
malloc: nano zone abandoned due to inability to preallocate reserved vm space.
but I havent been able to solve this and dont know if they are related or not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在深入研究此问题之后,我发现了Mach-O错误,例如,我们将文件和框架嵌入/将文件和框架链接到我们的项目中。
在我的案例研究中:
集成的Rumsdk(Datadog)与AppCentersDK一起进行分析以进行崩溃 - 我正在完全迁移到朗姆酒!
Rumsdk包括许多依赖性,例如CrashReporter和Datadogcrashreporter。首先是Apple本身,后来由Datadog团队制作。
请注意,Rumsdk是一个动态库,AppCentersDK是静态库。
动态库应始终嵌入和链接,它们将在编译后和运行时链接到App的二进制文件。它们将在您的应用程序包中的Frameworks文件夹下链接。
不应嵌入静态库,因为它们将在编译时间将其链接到应用程序的二进制本身。
现在想象一下,AppCenter和Rumsdk的CrashReporters都使用了CrashReportersDK。这意味着crastReporter将两次包含在您的应用程序捆绑包中,一次是在应用程序二进制中,并且一次包含在框架中。这会导致查找和链接必要框架的问题。
我的案例研究就是一个例子,但我可以认为这可能在试图在您的项目中添加3RDPARTY库和依赖项时发生。然后,您应该确保应用程序所需的所有内容嵌入或链接,并且应消除其不需要的内容。 Xcode中的位置是:
After digging deep into this problem I found out Mach-O error such as this one are related how we embed/link the files and frameworks into our project.
In my case study:
Integrated RumSDK (datadog) for analytics alongside AppCenterSDK for crashes - I am in the process of migrating completely to RUM!
RumSDK includes many dependency such as CrashReporter and DataDogCrashReporter. First one is from apple itself and the later is made by DataDog team.
Note that RumSDK is a Dynamic library and AppcenterSDK is static library.
Dynamic libraries should always be embeded and linked, they will be linked to app's binary after compilation and in runtime. They will be linked under frameworks folder in your app bundle.
Static libraries shouldnt be embeded because they will atomatically be linked at compile time to the app's binary itself.
Now imagine the CrashReporterSDK is used by both CrashReporters of Appcenter and RumSDK. This means that CrashReporter will be included in your app bundle twice, once in the app binary and once included in frameworks. This causes a problem of finding and linking the necessary frameworks.
My case study is an example but I could think that this might happen while trying to add 3rdParty libraries and dependencies to your project. Then you should make sure every thing your app needs is embeded or linked and the ones that it doesnt need should be eliminated. And the places to look in xcode are: