6

When I try building for archiving for my app in Xcode (version 4.5) I get an error that says:

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/[myrealname]/Downloads/[myappname]/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s

clang: error: linker command failed with exit code 1 (use -v to see invocation) It then says under it:

(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/shakerite/Downloads/shakeritetestnotrealone_v15_iOS/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s

Does anyone know how to solve this?

shak77
  • 63
  • 1
  • 1
  • 3
  • possible duplicate of [file is universal (3 slices) but does not contain a(n) armv7s slice error for static libraries on iOS, anyway to bypass?](http://stackoverflow.com/questions/12402092/file-is-universal-3-slices-but-does-not-contain-an-armv7s-slice-error-for-st) – Tim Sep 25 '12 at 22:16

3 Answers3

15

I received a very similar message just the other day when I tried running my app on my iPad after several successful attempts on the simulator. I found out that under the build settings I had to make "build active architecture only" to yes. Then my app would compile on my device. Hope this helps.

Douglas
  • 2,524
  • 3
  • 29
  • 44
  • Hi Douglas, I don't see where it says "build active architecture only." Is it under build settings for the target or the project? – shak77 Sep 27 '12 at 14:20
  • 1
    @shak77, the Build Active Architecture Only is under targets and then build settings. However, you do need to pick All instead of Basic! It is at the top of the build setting pane on the left. – Douglas Sep 27 '12 at 17:22
  • @shak77, glad to hear. Don't forget to accept the answer, so the question will be closed! I am glad that I could help. – Douglas Sep 27 '12 at 23:51
  • Thanks.....a lot..i got similar Error.....but thanks to @Douglas...Really Much Helpful..and saved my lot of hours..+1 from my side for this – Ankit Gupta Sep 29 '12 at 05:59
  • This works! Anyway if you do not have separate build targets for different devices, it wold be wise to change in the project settings rather than target settings – Deepak G M Oct 03 '12 at 10:25
3

Yeah, I had this same exact problem. Click on your project in xcode. Then, click on the target. Go to build settings and look for valid architectures. Delete armv7s from the list of valid architectures and just leave armv7.

Let me know if you have any questions!

Tommy Devoy
  • 13,441
  • 3
  • 48
  • 75
  • I'll make sure to try this when I get on my computer with the app. Thanks so much. – shak77 Sep 26 '12 at 13:04
  • Make sure your changing 'Valid Architectures' and not 'Architectures' – Tommy Devoy Sep 27 '12 at 16:58
  • @ttarules, This is Douglas. I just wanted to one up you, because I just got a new device and got the Mach O error. So I followed my answer and got no where. So I tried yours out and it worked great. Thanks for the help. – Douglas Dec 06 '12 at 00:26
1

here I provide you one temporary solution that can solve this error hope its help you,

go to Project->Build Settings->Build Active Architecture Only->yes

thats it.

Zaheer Ahmed
  • 28,160
  • 11
  • 74
  • 110
iKambad
  • 351
  • 1
  • 2
  • 13