James
James

Reputation: 1553

Upgrading to xcode 4 error No architectures to compile for

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).

Upvotes: 41

Views: 30866

Answers (8)

becker
becker

Reputation: 349

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

Upvotes: 0

serenn
serenn

Reputation: 1828

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!

Upvotes: 2

dreadbot
dreadbot

Reputation: 962

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

Upvotes: -1

speznaz
speznaz

Reputation: 98

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.

Upvotes: 3

Jano
Jano

Reputation: 63707

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".

Upvotes: 16

Ashley D'Andrea
Ashley D'Andrea

Reputation: 5159

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 ...

Upvotes: 3

samwize
samwize

Reputation: 27383

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

Upvotes: 13

James
James

Reputation: 1553

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.

Upvotes: 58

Related Questions