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

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?

This question is related to ios objective-c xcode ios6 static-libraries

The answer is


use menu Project -> Build Settings ->

then remove armv7s from the"valid architectures". If standard has been chosen then delete that and then add armv7.


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.


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.


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


In my case, I was linking to a third-party library that was a bit old (developed for iOS 6, on XCode 5 / iOS 7). Therefore, I had to update the third-party library, do a Clean and Build, and it now builds successfully.


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


In case this happens to someone. I built my own library to use with a third party code. While I was building it to deliver, I accidentally left my iPhone 4S plugged in, and so Xcode built my library only for the plugged architecture instead of following the project settings. Remove any plugged in devices and rebuilt the library, link it, and you should be all right.

Hope it helps.


Examples related to ios

Adding a UISegmentedControl to UITableView Crop image to specified size and picture location Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Autoresize View When SubViews are Added Warp \ bend effect on a UIView? Speech input for visually impaired users without the need to tap the screen make UITableViewCell selectable only while editing Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64

Examples related to objective-c

Adding a UISegmentedControl to UITableView Keep placeholder text in UITextField on input in IOS Accessing AppDelegate from framework? Warp \ bend effect on a UIView? Use NSInteger as array index Detect if the device is iPhone X Linker Command failed with exit code 1 (use -v to see invocation), Xcode 8, Swift 3 ITSAppUsesNonExemptEncryption export compliance while internal testing? How to enable back/left swipe gesture in UINavigationController after setting leftBarButtonItem? Change status bar text color to light in iOS 9 with Objective-C

Examples related to xcode

Undefined Symbols error when integrating Apptentive iOS SDK via Cocoapods Xcode 12, building for iOS Simulator, but linking in object file built for iOS, for architecture arm64 iPhone is not available. Please reconnect the device Make a VStack fill the width of the screen in SwiftUI error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65 The iOS Simulator deployment targets is set to 7.0, but the range of supported deployment target version for this platform is 8.0 to 12.1 Xcode 10.2.1 Command PhaseScriptExecution failed with a nonzero exit code Git is not working after macOS Update (xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools) Xcode 10: A valid provisioning profile for this executable was not found Xcode 10, Command CodeSign failed with a nonzero exit code

Examples related to ios6

ios simulator: how to close an app Is it possible to install iOS 6 SDK on Xcode 5? How to change navigation bar color in iOS 7 or 6? Detect if the app was launched/opened from a push notification The operation couldn’t be completed. (com.facebook.sdk error 2.) ios6 Evenly space multiple views within a container view how to fix the issue "Command /bin/sh failed with exit code 1" in iphone Setting font on NSAttributedString on UITextView disregards line spacing How do I animate constraint changes? What are Unwind segues for and how do you use them?

Examples related to static-libraries

"relocation R_X86_64_32S against " linking Error How do I tell CMake to link in a static library in the source directory? File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass? What's the difference between .so, .la and .a library files? Telling gcc directly to link a library statically static linking only some libraries How to compile a static library in Linux? Difference between static and shared libraries? Trying to include a library, but keep getting 'undefined reference to' messages DLL and LIB files - what and why?