Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Upgrading to xcode 4 error No architectures to compile for

Tags:

xcode

ios

xcode4

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

like image 836
James Avatar asked Feb 06 '11 20:02

James


People also ask

How to remove VALID_ ARCHS?

Unset Valid Architectures To remove this setting from a target, use the Delete key to remove it. Once VALID_ARCHS is no longer set for a target, it will disappear from the User-Defined build setting group. Ensure you completely remove VALID_ARCHS by using the Delete key.

What is Valid_archs?

VALID_ARCHS (Valid Architectures) Space-separated list of identifiers. Specifies the architectures for which the binary may be built. During the build, this list is intersected with the value of ARCHS build setting; the resulting list specifies the architectures the binary can run on.

Does not contain the x86_64 architecture?

a library doesn't contain the x86_64 architecture (You can run lipo -info /path/to/your/lib. a to verify it). If you don't have the source code of the library, you have to modify your own project. In the build settings, change the valid architectures to armv7 and i386 , or change Architectures to armv7 only.

What is build active architecture only?

The "build active architecture only" setting causes everything except the current Mac's architecture to be ignored (and the current one is of course valid), hiding the problem. Instead, you should look up a row or two in the settings, and change the "Architectures" setting to "Standard".


2 Answers

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.

like image 92
James Avatar answered Oct 16 '22 01:10

James


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

like image 16
Jano Avatar answered Oct 16 '22 02:10

Jano