After Xcode 4 upgrade ‘No architectures to compile for’ building error occures
Question: I am also upgrading my iPhone projects to Xcode 4 but getting “No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv6 armv7)” error message. I am running Xcode on OS X 10.6. Error occurs both in Debug and Release mode. I am full of new warnings. The same code builds without warnings in Xcode 3.2.
Answer: Apple’s Xcode 4 is different from its earlier version. We have to learn a new user interface and must workaround some birth defects. Try out these steps:
– Navigate to Build Settings tab and check out the Architectures group
– Look at the values, for example Architectures: Standard (armv6 armv7), Base SDK: Latest iOS (iOS 4.3), Build Active Architecture Only: No, Supported Platforms: iphonesimulator, iphoneos and Valid Architectures: armv6 armv7 i386.
– If “Valid Architectures” is set only to armv6 and armv7, delete both. Restart Xcode. I do not know why but some of you reported that it helped. Set “Valid Architectures” to $(ARCHS_STANDARD_32_BIT). Valid Architectures will show armv6 and armv7 again but this time it may compile just fine. Strange though.
– Besides standard armv6 and armv7, manually add i386 to “Valid Architectures”. Note that i386 is a valid architecture since the Simulator is running on your Intel iMac (or MacBook Pro).
Notes:
– Change your code to reduce the number of warnings like this:
How to build and submit iPhone app to AppStore with Xcode 4
How to change targets of resource files in Xcode 4 project
Xcode 4 does not fire breakpoints
if (self = [super init]) {
with:
if ((self = [super init])) {