user1289479
user1289479

Reputation: 301

Xcode iOS6 compile errors: No architecture

So I just recently updated Xcode to 4.5 and was able to get my hands on a iOS6 phone. I was doing testing on the simulators fine (4.3/5.1/6.0) but when i decided to build on the actual iOS 6 phone it gave me this error.

No architectures to compile for (ONLY_ACTIVE_ARCH=YES, active arch=armv7s, VALID_ARCHS=armv6 armv7 i386).

I did some lookup and fixed it by going into build settings to change the valid architectures to include armv7s and it did what it was suppose to do.

HOWEVER by adding that I got this error

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: some static library framework for architecture armv7s

After some looking it feels to me the static library framework is causing all the problems since it doesn't support iOS 6 and I'm not too optimistic that it can be fixed easily. However since I couldn't fine my exact situation on the net I'm hoping there's someone who knows this better than me and can help me. Thanks

Note: that static library is everywhere in the code, removing it is pretty much not an option

Upvotes: 7

Views: 7549

Answers (5)

Jayprakash Dubey
Jayprakash Dubey

Reputation: 36447

I has similar problem. Got it solved by changing 'Build active Architecture Only' to 'NO' in Build settings of Target Project.

enter image description here

Upvotes: 1

Autobots
Autobots

Reputation: 1274

You can try to change "Build Active Architecture Only" YES --> NO. Works well for me.

Upvotes: 10

Chris Devereux
Chris Devereux

Reputation: 5473

In order to build, all the static libraries an application links against must generate code for all of the application's architectures.

It looks like Xcode 4.5 has updated your project to build armv7s code, but it neglected to add armv7s to the application's active architectures.

Once you fixed that, it looks like the problem is that the static library is not producing armv7s code, but your application is trying to build for armv7s.

If that's the problem, there are two ways to fix this. Either you want your application to only generate armv7 code (removing the need for armv7s code), for which you'll need to change your application's target settings to:

enter image description here

... or you want your application and all linked static libraries to have build settings that look like this:

enter image description here

armv7 code will run on anything from the 3gs upwards. armv7s code will run on the iPhone 5 only, and will be slightly faster.

So if you have access to an iPhone 5 to test on, and you have the source code to the static library then the second option is probably best. Otherwise, assuming that your library is at least generating armv7 code, then as long as your application isn't trying to build armv7s you should also be fine.

If the library is only building armv6 code, which isn't supported by xCode 4.5, then you'll need to change its build settings to produce at least armv7 code.

Upvotes: 5

Eiko
Eiko

Reputation: 25632

Xcode 4.5 doesn't support armv6 anymore, so you need to remove this architecture.

As you already found out, the library you use doesn't seem to support armv7, which now is essential.

I think there is no alternative to compiling the library with the correct target. If you have the source code, this should be trivial; if it's third party, you depend on them to update. They will know, however, that without updating their library has reached end of life.

Upvotes: 2

Vinnie
Vinnie

Reputation: 1730

Remove armv7s and add armv7 (and/or armv6)

Upvotes: 0

Related Questions