Question

I have a published application which supports both amrv6 and armv7. Now I have an upgrade which is only compliant with armv7 (I added an external library which depends on armv7). When I try to submit the app to the store it I get the error detailed in

I understand the previous error and I need to change my app so it supports both architectures. My problem is that my code depends on a library which is only compliant with armv7. If I change the properties of my project to support both armv6 and armv7 I get a compilation error (details below). I need to be able to compile the code with support for both architectures: armv7 compiles using the library I depend on armv6 has a different code which does not depend on the library.

How can I achieve this?

Error details:

• the compile crash is in one Lib file (.a) and the error says : ld: warning: directory not found for option '-L/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS5.0.sdk/usr/lib/gcc/arm-apple-darwin10/4.0.1' ld: in /Users/.../(lib file).a, file is universal but does not contain a(n) armv6 slice for architecture armv6 Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/llvm-gcc-4.2 failed with exit code 1

Thanks in advance

Was it helpful?

Solution

Well i realized my last answer in not the correct one... Apple said that is impossible but this is not really true... thanks to Jim, i search little more and i found one way to do it..

  1. Remove lib from "Build Phases"
  2. Add both architectures in "Other Linker Flags" (Build Settings) , for that you need click in + and add armv6 and armv7
  3. Add the lib in armv7.. with -l
  4. Don't forget #if defined _ARM_ARCH_7 in your code

This is like Jim answered but more detailed.

OTHER TIPS

I received this answer from Apple:

You cannot conditionally build your app for either armv6 or armv7. Your static library must be built for both armv6 and armv7 since your application supports both of these architectures...You can drop support for armv6 by setting your iOS deployment target to 4.3 or higher.

Basically i need to ask the developer of the library to build for both of there architectures ( =/ ) or i set my minimum target to 4.3 and only armv7

In your build settings, if you hover over a setting, a + appears that you can click on to scope a setting to a particular architecture. You'll have to remove the library from the normal list of libraries and add it in by passing the -L argument manually only for armv7. You'll probably also have to add in a preprocessor definition so you can put #ifdefs around the code that calls the library.

Edit: Thinking about it, you might be able to do it in a simpler way by marking the library as optional in the build phases section.

I'm sorry, I pasted the wrong thing from clipboard.

I meant to say:

Simply remove the bad architecture from Valid Architectures in Target Aguilar Settings and you're good to go :)

I had the same problema so I switched: "Build Activate Architecture Only" to yes (in the Target -> Build Settings"

This works...for now.

I imagine my app will not work on an iPhone 5, but I will have to wait till the supplier of the static library I am using builds it for armv7/armv7s

I had this problem for the Google Analytics iOS SDK. Merely replacing the library with the latest version is what resolved this problem for me.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top