27

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

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?

https://i.stack.imgur.com/qWJ76.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
cyberlobe
  • 1,783
  • 1
  • 18
  • 30
Frenck
  • 6,514
  • 5
  • 22
  • 25
  • You'll need to show more than that. What was the entire command line that was being run? – mattjgalloway Feb 26 '12 at 21:51
  • Looks like you've got a rogue setting somewhere as it thinks armv6 is a file and the command line confirms that's what's happening. My suggestions is search the build settings for armv6 and check it's not randomly in there for some setting. – mattjgalloway Feb 26 '12 at 22:36

9 Answers9

22

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? :)

Change armv6 to: -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'

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!

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Blazer
  • 14,259
  • 3
  • 30
  • 53
  • 1
    This didn't solve the problem for me. I was getting the same error but it was because I was accidentally trying to set a value in NSLog. e.g. NSLog(@"%@", [[defaults setObject:@"test"] forKey:@"Test"]); –  Mar 10 '12 at 13:21
  • I found 6 questions like this with the same answer but my solution was this one. Thanks for the answer. – Jacksonkr Sep 29 '14 at 17:57
14

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.pch file. This is because Location of Prefix Header file [myapp]-Prefix.pch in Project Target is incorrect.

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.

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

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.

Happy Coding!

Rohit Gupta
  • 408
  • 5
  • 10
  • Make sure you are getting an error in your error log for this - It messes it up if you're not :P – Tyler Wall Jul 19 '12 at 21:27
  • 1
    +1 Thanks! That solved my problem. I was restructuring my files and later on, I was unable to build since it could not find my pch file. Great help. Thanks :) – Dexter Aug 20 '12 at 21:33
9

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.

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

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

apb
  • 3,270
  • 3
  • 29
  • 23
2

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
João Nunes
  • 3,751
  • 31
  • 32
1

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.

My Xcode version is 4.3.2.

Hope this could help you and all the reader.

The iOSDev
  • 5,237
  • 7
  • 41
  • 78
will
  • 11
  • 1
0

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.

fth
  • 2,478
  • 2
  • 30
  • 44
0

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

Jay Sampat
  • 195
  • 1
  • 8
0

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

Toby
  • 957
  • 2
  • 14
  • 34
0

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 was reporting this and other issues which were solved by deleting older intermediate files.

Andrew Bennett
  • 910
  • 11
  • 11