1

I recently upgraded my project from Xcode 4.0.1 to Xcode 4.2 - and everything went pretty smoothly, I did some debugging in the simulator and then I decided to build with device.

My device is a 2nd gen iPod Touch running 4.2.1, so I initially attempted to build to it and got this error:

An unknown error message 'IncorrectArchitecture', was received from the device.

As you do with most error messages, I googled it, and found this question.

After reading the answer, I proceeded to check up on my target architectures, and it turns out I only had armv7 as an architecture to build for. - I added the armv6 architecture, as the answer suggests, but when I built it, I got a load of build warnings/errors such as:

ignoring file /some/path/to/a/staticlibrary.a, file was built for archive which is not the architecture being linked (armv6)

This occurs on all the static libraries in my project, such as the kal library - libkal.a and all the three20 libraries.

Those libraries linked fine in Xcode 4.0.2 - and it also built fine to my iPod - so why will the armv7 architecture not build AND the libraries not link for armv6 in Xcode 4.2? - I'm really confused - any suggestions would be greatly appreciated.

Community
  • 1
  • 1
Alex Coplan
  • 13,211
  • 19
  • 77
  • 138
  • This might help http://stackoverflow.com/questions/8058177/app-built-with-xcode-4-2-ios-5-0-crashing-when-installed-on-iphone-with-ios-4-3 You probably have to set valid architectures to armv6 armv7 – Jesse Black Jan 14 '12 at 18:50
  • @Maudicus - thanks, I tried all the solutions in the answer linked to in your answer, and the one you suggested, and my project was already set to all those apart from the compiler, which had no effect so I changed it back – Alex Coplan Jan 14 '12 at 19:04

1 Answers1

3

Add ARMV6 to your build settings like this:

  1. Select your build settings
  2. Scroll to Architectures
  3. Doubletap on the existing entry
  4. Tap on +
  5. Enter armv6
  6. Tap on Done

You will need to do this for all projects that are linked with your app (e.g. three20).

enter image description here

Till
  • 27,559
  • 13
  • 88
  • 122
  • cheers - and is this for just the "target" or just the "project" or both for each linked project? – Alex Coplan Jan 14 '12 at 20:05
  • Make sure it is setup this way for the target. – Till Jan 14 '12 at 20:06
  • Oh my god. It actually built. Thank you so much! - However, I now have 58 warnings... all of them aren't my code but most from Three20 (51) and some from other externals in my project - it seems Xcode 4.2 is a lot stricter about things like calling properties just to initialise them without actually using them (setting anything to them) - three20 does that a lot - plus adding the extra architecture I believe made Xcode duplicate every warning - anyway thank you very much! – Alex Coplan Jan 14 '12 at 20:17