尝试使用Xcode 8 Beta 3运行我的应用程序时出错 [英] Error while attempting to run my app using Xcode 8 Beta 3

查看:38
本文介绍了尝试使用Xcode 8 Beta 3运行我的应用程序时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I know a lot of people are getting this error when trying to compile their app in Xcode 8 Beta 3, however none of the available answers here seemed to help me.

尝试运行我的应用程序时,出现了常见错误:(空):发现了意外的Mach-O标头代码:0x72613c21 ,当我扩展信息时,得到了这个信息返回:

While trying to run my app, I got the usual error: (null): Found an unexpected Mach-O header code: 0x72613c21, and when I expanded the information, I was given this in return:

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 的某些内容,这可能会导致一些答案,但是我不确定.

Note: I see something in the file path about Swift_2.3 which might lead to some answers, but I am not sure.

我的Podfile也可能有问题,因此我按照

It could have also possibly been a problem with my Podfile, so I followed the directions posted in this StackOverflow answer and pasted the following line of code into my podfile, so that at the end my podfile looked like this:

# 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

我更新了豆荚.

但是,实际上什么也没做.

However, that effectively did nothing.

这是一个非常烦人的错误,因为我刚刚花了两个小时来修复代码中的错误,现在却收到了一个错误,甚至可能不是我的错.

This is a super annoying error, because I just spent the last two hours fixing bugs in my code and now I get an error that is probably not even my fault.

如果有人可以帮助我,那就太好了.谢谢!

If anybody could help me out, that would be awesome. Thanks!

推荐答案

好像此问题已在Xcode 8.0(测试版4)中得到解决..因此,您无需尝试遵循以下内容.

Looks like this issue has been fixed in Xcode 8.0 (beta 4).. So you don't need to try following stuff.

当构建同时包含swift和objc标头时,Xcode似乎与Toolchain目录路径混淆了.

Issue seems to be with Xcode was getting confused with Toolchain directory path, when build includes both swift and objc headers.

一种解决方法是

  1. 修补SDK头文件以与编译器一起使用(愚蠢的事情不喜欢新的标题!)或
  2. 使用旧的头文件(其中很棒,但是有些东西不再起作用/存在了!)或
  3. 在Makefile中使用以下设置以避免警告和编译和链接时出现错误:

CC =/usr/bin/clang

CC=/usr/bin/clang

CFLAGS = -fsigned-char -g -ObjC -fobjc-exceptions \-Wall -Wundeclared选择器-Wreturn类型-Wnested-externs \-多余的决定\-不良功能播报\-Wchar下标\-Winline -Wswitch -Wshadow \-I/var/include \-I/var/include/gcc/darwin/4.0 \-D_CTYPE_H_ \-D_BSD_ARM_SETJMP_H \-D_UNISTD_H _

CFLAGS=-fsigned-char -g -ObjC -fobjc-exceptions \ -Wall -Wundeclared-selector -Wreturn-type -Wnested-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 =

CPPFLAGS=

LD = $(CC)

LD=$(CC)

LDFLAGS = -lobjc \-F/系统/库/框架\框架CoreFoundation \-框架基金会\-framework UIKit \框架CoreGraphics \-L/usr/lib -lc/usr/lib/libgcc_s.1.dylib \-bind_at_load \-multiply_defined抑制

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 suppress

这篇关于尝试使用Xcode 8 Beta 3运行我的应用程序时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆