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:
replace:
if (self = [super init]) {
with:
if ((self = [super init])) {
– armv6 notices: Apple initiated a major hardware cutoff with iOS 4.3. iOS 4.3 removed support for any of the armv6 based gadgets. Old iPod touch/iPhone (1G, 2G, 3G) devices are all running on arm v6 CPU. Armv6 compilers does not work with armv7 or above, but with Xcode 4 you can build apps for old devices running iOS 4.2 or earlier. In your code look for iOS and hardware versions to use the proper framework or other objects otherwise you get exceptions at runtime. It seems Apple prepares the road for armv8 devices and iOS 5. – My first impression was … a shock and anger to be forced to learn a new Xcode GUI again. In the past two months I’ve been using it extensively. XCode 4 finally offers what Microsoft Visual Studio does for more than 10 years, a realtime code checking and other odds and ends. Sadly, the average time needed to finish a project has increased a little bit and I had to buy two large 27′ monitors for split views. It could have been the default hardware configuration for app designers and programmers of Xcode 4. Links: 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