41

I am getting an error after upgrading to xcode 4, for all of the library projects that my application depends on.

[BEROR]No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=i386, VALID_ARCHS=armv6).

1
  • 8
    Well as of today the question is legitimized. :-) Commented Mar 10, 2011 at 1:21

8 Answers 8

58

It looks like all you have to do is add i386 to the Valid Architectures in the build settings. I was compiling for the simulator, and that's why it was complaining.

This seems odd, because the project worked just fine before upgrade. It looks to me like you have to do this for any project you upgrade. At least that will work for now.

3
  • 8
    Build Settings, Architecture section, Valid Architectures option, click grey arrow to expand, double-click on right of Debug, after "armv6 armv7" add "i386". Thanks James!
    – rjobidon
    Commented Mar 14, 2011 at 0:05
  • 1
    Thank you @rjobidon for making this so clear! This is the only answer that worked for me.
    – nacho4d
    Commented Mar 23, 2011 at 19:39
  • This is exactly right. I think the source of the issue is the removal of the odd little "Device/Simulator" drop down option in Xcode 3, which would apparently override your Valid Architectures settings if it had to. Xcode 4's setup is a mite trickier but makes a lot more sense to me.
    – Luke
    Commented May 25, 2011 at 19:58
16

See https://devforums.apple.com/message/376732#376732

"No architectures to compile for" means "Valid Architectures" field is empty. Update it to $(ARCHS_STANDARD_32_BIT) and you'll see the usual armv6 armv7. This happens sometimes in XCode 4 GM after updating "Base SDK" to "Latest SDK".

13

Open project.pbxproj (show package content of xcodeproj file), remove all lines with VALID_ARCHS = "...";, and restart Xcode.

1
  • 1
    Tried other suggestions, and this was the one one that fixed it for me. Commented Apr 1, 2011 at 2:18
3

Very strange. I encountered the same error and both the Debug and Release "Valid Architectures" were set to armv6 and armv7. (The same code compiles fine in Xcode 3.2.) I ended up deleting both settings, then expressly setting them to $(ARCHS_STANDARD_32_BIT) ... which in turn translates to armv6 and armv7 again ... and it compiles just fine now. No i386 needed. Hmm ...

3

If this error occures in combination with Phonegap the solution is:

Add "i386" in the build settings to the "Valid Architectures": for your project and the library (PhoneGapLib.xcodeProj). In both cases for the project and the target.

0
2

I was getting this error when I was trying to convert to automatic reference counting in the latest Xcode. I fixed it by adding "x86_64" to the valid architecture list, which allowed me to continue building.

Just in case someone else was having the same issue, thought I'd throw in what worked for me!

0

Had similar issues with xcode6 it seems to pop when upgrading xcode, tried all of what is suggested with no success what worked for me was in the new xcode created a simple new app(tabbed) and made sure my App had the same settings for architectures

-1

Open a new project and compile in Xcode 4 and then compare build settings with converted project. That's how I found it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.