尝试使用Xcode 8 Beta 3运行我的应用程序时出错

我知道很多人在尝试在Xcode 8 Beta 3中编译他们的应用程序时遇到这个错误,但是这里没有可用的答案似乎帮助我。

当试图运行我的应用程序时,我得到了通常的错误: (null): Found an unexpected Mach-O header code: 0x72613c21 ,当我扩展信息时,我得到了这个回报:

 Effective srcDirs: {( <DVTFilePath:0x6000008bb0c0:'/Applications/Xcode-beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/iphoneos'>, <DVTFilePath:0x6080002a00c0:'/Applications/Xcode-beta.app/Contents/Developer/Toolchains/Swift_2.3.xctoolchain/usr/lib/swift/iphoneos'> )} error: Found an unexpected Mach-O header code: 0x72613c21 

注意:我在Swift_2.3的文件path中看到了一些可能会导致一些答案的东西,但是我不确定。

这也可能是我的Podfile的一个问题,所以我按照这个StackOverflow答案中发布的指示,并将以下代码行粘贴到我的podfile中,以便在最后我的podfile看起来像这样:

 # Uncomment this line to define a global platform for your project platform :ios, '9.0' target 'Roast' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Database' pod 'Firebase/Auth' pod 'Firebase/AdMob' pod 'JSQMessagesViewController' target 'RoastTests' do inherit! :search_paths # Pods for testing end end target 'RoastKeyboard' do # Comment this line if you're not using Swift and don't want to use dynamic frameworks use_frameworks! pod 'Firebase' pod 'Firebase/Core' pod 'Firebase/Database' pod 'Firebase/Auth' # Pods for RoastKeyboard end post_install do |installer| installer.pods_project.targets.each do |target| target.build_configurations.each do |config| config.build_settings['ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'] = 'NO' end end end 

我更新了我的豆荚。

但是,那实际上什么也没做。

这是一个超级烦人的错误,因为我刚刚花了两个小时修复了我的代码中的错误,现在我得到一个错误,甚至可能不是我的错。

如果有人能帮助我,这将是非常棒的。 谢谢!

看起来这个问题已经在Xcode 8.0(testing版4)中解决了。 。 所以你不需要尝试下面的东西。

问题似乎与Xcode被混淆了工具链目录path,当构build包括swift和objc头。

一个解决的办法是

  1. 修补用于编译器的SDK头文件(愚蠢的东西不喜欢新的头文件!)或者
  2. 使用旧的头文件(这是伟大的,但有些东西不工作/存在相同了!)或
  3. 在Makefile中使用以下设置可避免编译和链接期间的警告和错误:

CC =的/ usr /斌/铛

CFLAGS = -fsigned-char -g -ObjC -fobjc-exceptions * -Wall -Wundeclared-selector -Wreturn-type -Wented-externs \ -Wredundant-decls \ -Wbad-function-cast \ -Wchar-subscripts \ -Winline – Wswitch -Wshadow \ -I / var / include \ -I / var / include / gcc / darwin / 4.0 \ -D_CTYPE_H_ \ -D_BSD_ARM_SETJMP_H \ -D_UNISTD_H_

CPPFLAGS =

LD = $(CC)

LDFLAGS = -lobjc \ -F / System / Library / Frameworks \ -framework CoreFoundation \ -framework Foundation \ -framework UIKit \ -framework CoreGraphics \ -L / usr / lib -lc /usr/lib/libgcc_s.1.dylib \ bind_at_load \ -multiply_defined压制