xcode Apple LLVM 编译器 3.1 错误叮当声

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9457510/
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-09 04:16:13  来源:igfitidea点击:

Apple LLVM Compiler 3.1 error clang

xcode

提问by Frenck

I'm trying to make an archive (ipa) for my iOS (iPhone) app but I'm receiving a strange error:

我正在尝试为我的 iOS (iPhone) 应用程序制作存档 (ipa),但收到一个奇怪的错误:

Apple LLVM Compiler 3.1 error clang: error: no such file or directory: 'armv6'

Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang failed with exit code 1

Does anyone know how i can fix this?

有谁知道我该如何解决这个问题?

http://i.imgur.com/PKOHx.png

http://i.imgur.com/PKOHx.png

ProcessPCH /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/PrecompiledHeaders/myapp-Prefix-cgigtilzpjcadpbgpxbabnqczfxd/myapp-Prefix.pch.pth

     myapp/myapp-Prefix.pch normal armv7 objective-c
     com.apple.compilers.llvm.clang.1_0.compiler
             cd /Users/wazapi/Downloads/myapp
             setenv LANG en_US.US-ASCII
             setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
             /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
     -x objective-c-header -arch armv7 -fmessage-length=0 -std=gnu99 -fobjc-arc -Wno-trigraphs -fpascal-strings -Os -Wno-missing-field-initializers -Wmissing-prototypes -Wreturn-type -Wno-implicit-atomic-properties -Wformat -Wno-missing-braces -Wparentheses -Wswitch -Wno-unused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wno-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-sign-compare -Wno-shorten-64-to-32 -Wpointer-sign -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wno-undeclared-selector -Wno-deprecated-implementations -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk
     -Wprotocol -Wdeprecated-declarations -g -fvisibility=hidden -Wno-conversion -Wno-sign-conversion -mthumb "-DIBOutlet=__attribute__((iboutlet))"
     "-DIBOutletCollection(ClassName)=__attribute__((iboutletcollection(ClassName)))"
     "-DIBAction=void)__attribute__((ibaction)" -miphoneos-version-min=5.0
     -iquote /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/myapp-generated-files.hmap
     -I/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/myapp-own-target-headers.hmap
     -I/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/myapp-all-target-headers.hmap
     -iquote /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/myapp-project-headers.hmap
     -I/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/BuildProductsPath/Release-iphoneos/include
     -I/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/DerivedSources/armv7
     -I/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/IntermediateBuildFilesPath/myapp.build/Release-iphoneos/myapp.build/DerivedSources
     -F/Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/BuildProductsPath/Release-iphoneos
     -F/Users/wazapi/Downloads/myapp armv6 --serialize-diagnostics /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/PrecompiledHeaders/myapp-Prefix-cgigtilzpjcadpbgpxbabnqczfxd/myapp-Prefix.pch.dia
     -c /Users/wazapi/Downloads/myapp/myapp/myapp-Prefix.pch -o /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/PrecompiledHeaders/myapp-Prefix-cgigtilzpjcadpbgpxbabnqczfxd/myapp-Prefix.pch.pth
     -MMD -MT dependencies -MF /Users/wazapi/Library/Developer/Xcode/DerivedData/myapp-hjzccpnbaymgcufalpjtfeuqvjvu/Build/Intermediates/ArchiveIntermediates/myapp/PrecompiledHeaders/myapp-Prefix-cgigtilzpjcadpbgpxbabnqczfxd/myapp-Prefix.pch.d

采纳答案by Blazer

OK, what you need to do is go to build settings and scroll down to :

好的,您需要做的是转到构建设置并向下滚动到:

Apple LLVM Compiler 3.1 - Language

Search in the table for 'other c flags'. What you see is armv6? Right? :)

在表中搜索“ other c flags”。你看到的是armv6什么?对?:)

Change armv6to: -DNS_BLOCK_ASSERTIONS=1

更改armv6为:-DNS_BLOCK_ASSERTIONS=1

Good luck, Nathan

祝你好运,内森



  1. Click on your project (Usually on top of your in-Xcode-file-browser - blue Xcode icon).
  2. Go to [Your project]under Targets.
  3. Click on the Build Settings.
  4. Search in the search box for: 'other c flag'. (On mine there were three options - disregard all options except the bold 'Other C Flags.')
  5. Click on the third column of 'Other C Flags' and enter: '-DNS_BLOCK_ASSERTIONS=1'
  1. 单击您的项目(通常在您的 Xcode 文件浏览器顶部 - 蓝色 Xcode 图标)。
  2. 转到[Your project]目标下。
  3. 单击Build Settings
  4. 在搜索框中搜索:'other c flag'。(我的有三个选项 - 除了粗体的“其他 C 标志”之外,忽略所有选项。)
  5. 单击“Other C Flags”的第三列并输入:“ -DNS_BLOCK_ASSERTIONS=1

Image of what It should Look like when you're done

Image of what It should Look like when you're done

That should do it :)

那应该这样做:)

(I also had some files missing, look at your build log and make sure there are no other errors above the one mentioned for this question)

(我还丢失了一些文件,请查看您的构建日志并确保在此问题提到的错误之上没有其他错误)

Good luck!

祝你好运!

P.S. - May Xcode die a slow and painful death!

PS - 愿 Xcode 缓慢而痛苦地死去!

回答by Rohit Gupta

I got similar error. Following steps fixed my problem, not sure if this is going to work for you, but worth a shot:

我得到了类似的错误。以下步骤解决了我的问题,不确定这是否适合您,但值得一试:

Issue: Compiler unable to locate [myapp]-Prefix.pchfile. This is because Location of Prefix Header file [myapp]-Prefix.pchin Project Target is incorrect.

问题:编译器无法找到[myapp]-Prefix.pch文件。这是因为Project Target中 Prefix 头文件[myapp]-Prefix.pch 的位置不正确。

The location is defined in Project Target/Build setting. You will need to go to: Project Target -> Build Settings Tab -> Scroll down and Look for "Apple LLVM Compiler 3.1 - Language" Underneath this node -> You will find the key/value setting for Prefix Header file.

该位置在项目目标/构建设置中定义。您需要转到:项目目标 -> 构建设置选项卡 -> 向下滚动并在此节点下方查找“Apple LLVM 编译器 3.1 - 语言” -> 您将找到前缀头文件的键/值设置。

Normally Prefix header file is located under "Supporting File" Folder in your project

通常 Prefix 头文件位于项目中的“Supporting File”文件夹下

Please note, I am using Xcode 4.3.2 so if you are using a version other than this you might have to look around a bit for this setting.

请注意,我使用的是 Xcode 4.3.2,所以如果您使用的不是这个版本,您可能需要四处看看这个设置。

Happy Coding!

快乐编码!

回答by apb

I had this same issue and none of the above answers were working for me.

我遇到了同样的问题,上述答案都不适合我。

I discovered that if I opened a project from the command line, i.e. open test.xcodeproj/, even a brand new project from a template would fail to compile with the error above.

我发现如果我从命令行打开一个项目,即open test.xcodeproj/,即使是来自模板的全新项目也无法编译,并出现上述错误。

However, if I opened Xcode first and chose the project from the splash screen, everything worked just fine.

但是,如果我先打开 Xcode 并从初始屏幕中选择项目,则一切正常。

Leaving this here in case anyone else is stuck banging their head against the wall.

把这个留在这里,以防其他人被困在用头撞墙。

回答by Jo?o Nunes

I had this problem

我有这个问题

You are using this compiler flags in your build Phases --> Compile Sources

您在构建阶段使用此编译器标志 --> 编译源

File.m  -fno-objc-arc armv6

Replace it to:

将其替换为:

File.m  -fno-objc-arc

回答by will

I got similar error, it seems there have many solutions to fix it, maybe.

我遇到了类似的错误,似乎有很多解决方案可以解决它,也许吧。

Project Setting -> Building Setting -> Apple LLVM compile 3.1 - Launguage -> Objective-C Automatic Reference Counting.The default value is YES, modify it to NO.

项目设置 -> 构建设置 -> Apple LLVM 编译 3.1 - 语言 -> Objective-C 自动引用计数。默认值为YES,修改为NO

My Xcode version is 4.3.2.

我的 Xcode 版本是 4.3.2。

Hope this could help you and all the reader.

希望这可以帮助您和所有读者。

回答by Fatih Karatana

I got the same error for LLVM Compiler 4.1 and it says that it could not found the file(s). I clean the project and open the Build Phases from Targets/Target section and remove all irrelevent files then rebuild the project and it worked.

我在 LLVM Compiler 4.1 中遇到了同样的错误,它说找不到文件。我清理项目并从目标/目标部分打开构建阶段并删除所有不相关的文件然后重建项目并且它工作。

回答by Jay Sampat

Also in build configuration you can change "Compiler for C/C++/Objective-C" to Default Compiler (Apple LLVM compiler 3.1)

同样在构建配置中,您可以将“C/C++/Objective-C 编译器”更改为默认编译器(Apple LLVM 编译器 3.1)

回答by Toby

For me I was referencing a PCH that didn't exist, just search for 'pch' in your build settings and make sure any .pch files being referenced actually exist at that location, if not, update

对我来说,我引用了一个不存在的 PCH,只需在构建设置中搜索“pch”并确保引用的任何 .pch 文件确实存在于该位置,如果没有,请更新

回答by Andrew Bennett

I had this issue with an unchanged project which had built fine before. The issue turned out to be the RAM Disk that I was using for XCode intermediate files being full!

我在一个之前构建良好的未更改项目中遇到了这个问题。问题原来是我用于 XCode 中间文件的 RAM 磁盘已满!

XCode was reporting this and other issues which were solved by deleting older intermediate files.

XCode 正在报告这个问题和其他问题,这些问题通过删除旧的中间文件来解决。