File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass?

162,230

Solution 1

If you want to remove the support for any architecture, for example, ARMv7-s in your case, use menu Project -> Build Settings -> remove the architecture from "valid architectures".

You can use this as a temporary solution until the library has been updated. You have to remove the architecture from your main project, not from the library.

Alternatively, you can set the flag for your debug configuration's "Build Active Architecture Only" to Yes. Leave the release configuration's "Build Active Architecture Only" to No, just so you'll get a reminder before releasing that you ought to upgrade any third-party libraries you're using.

Solution 2

I've simply toggled "Build Active Architecture Only" to "Yes" in the target's build settings, and it's OK now!

Solution 3

Try to remove armv7s from project's "Valid architecture" to release from this issue for iOS 5.1 phone

Solution 4

I just posted a fix here that would also apply in this case - basically, you do a hex find-and-replace in your external library to make it think that it's ARMv7s code. You should be able to use lipo to break it into 3 static libraries, duplicate / modify the ARMv7 one, then use lipo again to assemble a new library for all 4 architectures.

Solution 5

Flurry Support for iPhone 5 (ARMv7s) As I mentioned in yesterday’s post, Flurry started working on a version of the iOS SDK to support the ARMv7s processor in the new iPhone 5 immediately after the announcement on Wednesday.

I am happy to tell you that the work is done and the SDK is now available on the site.

Share:
162,230
Dafna Elazazer
Author by

Dafna Elazazer

Updated on July 08, 2022

Comments

  • Dafna Elazazer
    Dafna Elazazer almost 2 years

    I upgraded Xcode version and when using external static libraries, I get this message:

    ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /file/location for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)

    Is there any way to bypass this and add support to the library if the developer of the library hasn't updated their library yet?

  • user513790
    user513790 over 11 years
    nice solution but is there a way to add support without compiling the library ?
  • Nicholas
    Nicholas over 11 years
    you don't have to recompile the library. you can remove this flag from the project that is using the library.
  • Dimillian
    Dimillian over 11 years
    I guess that the app will not work on the iPhone 5 then, am I right ?
  • Nicholas
    Nicholas over 11 years
    It will work, since old apps that have not been compiled with armv7s support have to run as well. But you will loose some specific optimizations. This should be a temporary workaround anyway.
  • MaxGabriel
    MaxGabriel over 11 years
    Can you explain this in more detail? Or is there something else I need to do? I have both Architectures and Valid Architectures set to armv7 but still have this problem.
  • railwayparade
    railwayparade over 11 years
    Dropbox framework has been updated for this issue see forums.dropbox.com/topic.php?id=90014
  • Fogmeister
    Fogmeister over 11 years
    Had to do this for TestFlight SDK. Thanks!
  • LoriHC
    LoriHC over 11 years
    For some projects, the problem might be the Architectures setting, and not the valid architectures setting. The meaning of $(ARCHS_STANDARD_32_BIT), despite being labeled as "Standard (armv7)" now appears to include armv7s also. Removing $(ARCHS_STANDARD_32_BIT) in favor of an explicit armv7 did the trick for me.
  • levigroker
    levigroker over 11 years
    Removing armv7s from the Valid Architectures list worked for me, however so did removing it from Architectures. In both cases, however, I would get No architectures to compile for (ARCHS=i386, VALID_ARCHS=armv7). from the linker which I could only solve by adding i386 to the Valid Architectures list.
  • Nicolas Miari
    Nicolas Miari over 11 years
    My project only supports armv7 and armv7s (not armv6) as 'valid architectures', yet getting this error when building for Device in SDK 6. (Using libOAuth.a)
  • Nicolas Miari
    Nicolas Miari over 11 years
    Oh, sorry; didn't read all the comments before commenting. I too removed armv7 s and now it's working
  • Nicolas Miari
    Nicolas Miari over 11 years
    What is 'armv7s' anyway? Nothing to do with the iPhone 4S I guess? ;)
  • Nicholas
    Nicholas over 11 years
    No, armv7s is the instruction set of the A6 processor that is being used in the iPhone 5. Since the A6 is backwards compatible, it will still run the armv7 instruction set.
  • Piero
    Piero over 11 years
    thank for this answer, but i don't understand i have to remove the armv7s only in the setting of the static library, or also for the Main Project Target?
  • OMGPOP
    OMGPOP over 11 years
    but theres only one flag in my project. not sure whether they r for build or for release
  • iPhoneDev
    iPhoneDev over 11 years
    I just set Build Active Architecture Only" to Yes . Now my project is running successfully.
  • thandasoru
    thandasoru over 11 years
    @Blasco73 Do you even know that you are awesome? You should. Here goes, You sir, are awesome!
  • esbenr
    esbenr about 11 years
    How can this be a good solution. It removes the error, but you only get build for the current arch, not all on the market...
  • mafiOSo
    mafiOSo over 10 years
    for me I had to remove armv7s and set "Build Active Architecture Only" to No and it worked.