File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass?
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.
Dafna Elazazer
Updated on July 08, 2022Comments
-
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?
-
Rajavanya Subramaniyan over 11 yearsThis seems to be a good solution for now - galloway.me.uk/2012/09/hacking-up-an-armv7s-library
-
-
user513790 over 11 yearsnice solution but is there a way to add support without compiling the library ?
-
Nicholas over 11 yearsyou don't have to recompile the library. you can remove this flag from the project that is using the library.
-
Dimillian over 11 yearsI guess that the app will not work on the iPhone 5 then, am I right ?
-
Nicholas over 11 yearsIt 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 over 11 yearsCan 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 over 11 yearsDropbox framework has been updated for this issue see forums.dropbox.com/topic.php?id=90014
-
Fogmeister over 11 yearsHad to do this for TestFlight SDK. Thanks!
-
LoriHC over 11 yearsFor 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 over 11 yearsRemoving 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 addingi386
to the Valid Architectures list. -
Nicolas Miari over 11 yearsMy 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 over 11 yearsOh, sorry; didn't read all the comments before commenting. I too removed armv7 s and now it's working
-
Nicolas Miari over 11 yearsWhat is 'armv7s' anyway? Nothing to do with the iPhone 4S I guess? ;)
-
Nicholas over 11 yearsNo, 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 over 11 yearsthank 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 over 11 yearsbut theres only one flag in my project. not sure whether they r for build or for release
-
iPhoneDev over 11 yearsI just set Build Active Architecture Only" to Yes . Now my project is running successfully.
-
thandasoru over 11 years@Blasco73 Do you even know that you are awesome? You should. Here goes, You sir, are awesome!
-
esbenr about 11 yearsHow 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 over 10 yearsfor me I had to remove armv7s and set "Build Active Architecture Only" to No and it worked.