views:

153

answers:

2

I'm getting the following error when including static libraries:

missing required architecture i386 in file

This worked 30 seconds previously, and only failed when I upgraded to Xcode 3.2.3. I've used "file" command to check - and, yes, XCode is building completely the wrong architecture (armv6 + armv7 instead of i386).

This seems to be a major bug in latest Xcode, where Apple has re-written the build / compile / link settings. There's a note in the release notes saying very vaguely that they've "Changed it" because it used to be "confusing". This is not helpful.

The build settings for the library VERY clearly say:

"Valid architectures: i386"

There's no confusion here - Xcode is building something other than what the target says it should.

The question is: how do you un-break this? How do you force Xcode to do what it's supposed to? I've re-installed Xcode from scratch, cleaned everything, and manually inspected the build files. There's nothing wrong (and, of course, it worked perfectly in xcode 3.2.2)

A: 

Right click on your Target app under Targets and make sure that the Base SDK is set to iOS.

ibeitia
I'm assuming you mean "iPhone Device 4.0" or "iPhone Simulator 4.0", since what you describe doesn't exist, as far as I know - if so, yes, it already is.
Adam
+1  A: 

After considerable research, I believe the answer is:

"this is now impossible - Apple has deliberately hard-coded XCode to ignore build settings"

However, I've come up with a script that automatically builds ALL platforms of a project (which you HAVE to do with static libraries - you don't have much choice now, because Apple has disabled Targets), and the script could easily be modified to do all targets, instead of all platforms:

http://stackoverflow.com/questions/3520977/build-fat-static-library-device-simulator-using-xcode-and-sdk-4/3647187#3647187

Adam
Have you filed a bug with apple?
tc.
Given they made this change *deliberately* (c.f. the release notes that give a hand-waving vague justification), I doubt they'll care about a bug report :(.
Adam