I cannot build and test on devices because Xcode gives me this error:
ld: file is universal (2 slices) but does not contain a(n) armv7 slice: /Users/------/Desktop/Running APP/------/-----/YACropImage.a file '/Users/------/Desktop/Running APP/------/-----/YACropImage.a' for architecture armv7
clang: error: linker command failed with exit code 1 (use -v to see invocation)
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.
Related
I have an issue when trying to use an external lib : I can't compile the project as it throws an exception as below.
ld: warning: ignoring file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a, missing required architecture x86_64 in file /Users/renaudcousin/Documents/XCode/WORK/StimShopPOC/StimShopPOC/libStimshop_SDK.a (3 slices)
Undefined symbols for architecture x86_64:
"_OBJC_CLASS_$_StimshopSDK", referenced from:
objc-class-ref in ViewController.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)`
I tried lots of solutions found on stackoverflow (but for XCode 5.1 and not as well explained) without any change ...
I also found this topic XCode 6.1 Missing required architecture X86_64 in file that exactly correspond to my problem and
when looking at my lib's architecture with lipo -info command, it seems it's missing i386 and x86_64. How could I add them to my library architectures to be able compile ?
This means your .a library doesn't contain the x86_64 architecture (You can run lipo -info /path/to/your/lib.a to verify it). If you don't have the source code of the library, you have to modify your own project. In the build settings, change the valid architectures to armv7 and i386, or change Architectures to armv7 only. However, by doing so, your project won't be compiled to the arm64 architecture, which is required when uploading to the App Store after Feb 2015, according to Apple's announcement.
If your library doesn't contain x86_64 architecture, it is likely that it doesn't contain arm64 either. So you should avoid using old libraries.
If a library doesn't have the X86_64 architecture you can build it if you've picked a connected device rather than a simulator for your build target.
Basically, you can still build and develop but you can't use the simulator.
Click on your project > build setting > architecture. Change architecture as armv7 and delete others like armv6,etc, Then it will work :-
In the project that builds libStimshop_SDK.a, be sure the "Architectures" setting is set to $(ARCHS_STANDARD) and that it includes 64-bit settings in the compiler settings. Be sure the "Valid Architectures" setting includes 64-bit as well.
I made the app in Xcode 4.6 and tested in device. The app is made for both iPhone and iPad. When I try to archive it to make .ipa file, I get this error :
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/admin/Desktop/appName/appName/libzbar.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
How to set the architecture for this in Build Settings? Or is there some different issue?
libzbar.a library needs to be built for armv7s architecture. If you cannot do that (because you don't have source code for this library) than you should remove armv7s from valid architectures.
You can change valid architectures by following steps:
select project name from the Project Navigator
select project target
open Build Settings tab
change valid architectures field
I updated my iphone4s and xcode to the latest yesterday. And I'm trying to debug my app on my phone since my application uses hardware communication.
I'm using a third party library from Redpark(the company provides Dock to RS232 wire.)
While compiling, it gives an error
ld: file is universal (2 slices) but does not contain a(n) armv7s slice:/Users/...../libRscMgrUniv.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Does anyone know how to solve this except waiting for Redpark to update there library?
You can simply disable the compilation of armv7s in your Build Settings, by replacing the $VALID_ARCHITECTURES (which evaluates to armv7 armv7s now) value by the explicit value armv7.
Thus your application will only build for armv7 and not armv7s, so will not be fully optimized for the new iPhone5, but it will still run on iPhone 4 and 5 anyway (the armv7s processor of the iPhone 5 can execute armv7 applications, it is just not as optimized as with armv7s processor dedicated instructions)
I did another search and found two solutions work for me.
Dafna
1. Go to Target Setting -> Build Settings -> Build Active Architecture Only -> change to NO.
2. Still in Build Settings -> Valid Architecture -> delete armv7s.
They both work for me. If you have the same problem, definitely try this first.
When I try building for archiving for my app in Xcode (version 4.5) I get an error that says:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/[myrealname]/Downloads/[myappname]/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s
clang: error: linker command failed with exit code 1 (use -v to see invocation)
It then says under it:
(null): File is universal (3 slices) but does not contain a(n) armv7s slice: /Users/shakerite/Downloads/shakeritetestnotrealone_v15_iOS/BT_Objects/TwitterOAuth/SAOAuthTwitterEngine/libOAuth.a for architecture armv7s
Does anyone know how to solve this?
I received a very similar message just the other day when I tried running my app on my iPad after several successful attempts on the simulator. I found out that under the build settings I had to make "build active architecture only" to yes. Then my app would compile on my device. Hope this helps.
Yeah, I had this same exact problem. Click on your project in xcode. Then, click on the target. Go to build settings and look for valid architectures. Delete armv7s from the list of valid architectures and just leave armv7.
Let me know if you have any questions!
here I provide you one temporary solution that can solve this error hope its help you,
go to Project->Build Settings->Build Active Architecture Only->yes
thats it.
Hi i have an App that supports armv6/armv7 architecture
My Problem is i have .framework file that was only available for armv7.
My Question is: How i can set the .framework file to compile only for arm7 architecture. I will support both architectures armv6/armv7 it is no option to set the architecture only to armv7
My Error message at the moment is:
ld: file is universal (2 slices) but does not contain a(n) armv6 slice: $(PROJECT_DIR)
error: linker command failed with exit code 1 (use -v to see invocation)