missing required architecture x86_64 in file - ios

When linking an iOS app I have the following issue:
(null): Ignoring file /Users/…../my_Lib.a, missing required
architecture x86_64 in file /Users/…/my_Lib.a (2 slices)
Seeing the message it seems like there is an issue with my_Lib.a.
After reading about similar problems on the net, I haven’t found any working solution at this point.
One detail I want to add is that I have a second project using this exact same library (my_Lib.a), which is perfectly working.
So there is nothing wrong with the library itself, only some settings are not right, probably inside the project.
Further more looking at the architecture settings on the two projects, they look pretty much the same.
When running lipo -info I get the following:
$ lipo -info my_Lib.a
Architectures in the fat file: my_Lib.a are: armv7 arm64
So what can I be doing wrong?

Please make the project settings as follows:
Architectures: Standard architectures (armv7, arm64)
and
Valid architectures: arm64 armv7s armv7

Related

How to remove unwanted architecture x86_64 from Xcode build?

I am trying to recompile someone else's code. The code includes a reference to a third party library myLib.a, which has two slices:
Architectures in the fat file: myLib.a are: armv7 arm64
I get this warning, following by a bunch of link errors:
ld: warning: ignoring file myLib.a, missing required architecture x86_64 in file myLib.a (2 slices)
Now, I know this library is not intended to work in a simulator. So I want to throw the simulator away from build. I don't really understand build targets, so I did this:
Still, same error. What am I doing wrong?
Xcode 7.3
I answered this question here: https://stackoverflow.com/a/65307436/5303139
Same anwser
For an iOS project, you have the following architectures: arm64 armv7 armv7s i386 x86_64
x86_64, i386 are used for the simulator.
What could be your problem is the framework you are using was build for iOS and not a simulator.
To fix this issue you can bypass the build framework and use lipo command lines.
First: lipo -info [The library.framework location]
Example Usage : lipo -info /Users/.../library.framework/LibrarySDK
Example output :
Architectures in the fat file: /Users/.../library.framework/LibrarySDK are: i386 x86_64 armv7 arm64
You will get the list of architecture used for that framework.
Second: we need to strip the framework from the simulator architecture and make 2 versions of that framework (1 is used for iOS Device and 1 for the simulator)
using: lipo -remove [architecture] [location] -o [output_location]
Example: lipo -remove i386 /Users/.../SDK -o /Users/.../SDK_Output_Directory
Go to your chosen output directory to get the new generated SDK without the removed architecture to verify you can use the lipo -info command same as above
You can use the same lipo remove command on the newly created SDK but with another architecture
lipo -remove x86_64 ... and you will get an SDK only for iOS devices
Third: Take that final SDK and rename it "SDK_Name_IOS" and use it.
Happy coding!!
You did set architect to armv7, arm64 so just change Build Active Architecture Only to YES in debug mode:
debug mode: YES
release mode: NO (default value)
So when debug you will build only for current device

missing required architecture x86_64

I have an old project, that I recompiled for an uodate, and it is now showing this error message:
…. missing required architecture x86_64 in file myLibrary.a ….
I have tried various tricks that I could find on the net after searching on missing required architecture x86_64 in file, but with no success. Anyone knows how to properly handle the issue?
I am using Xcode Version 7.0.1.
Running:
lipo -info myLibrary.a
shows:
Architectures in the fat file: myLibrary.a are: armv7 arm64
I have been able to add armv7s but not x86_64.
You are trying to build a universal library and it does not have all the architectures in it armv7 armv7s i386 x86_64 arm64. Compiler is complaining when you build with 64 bit architecture.
To fix this - Add the following to your architecture settings of static library project:
This needs manual addition of architectures something like this:
Build the library with these architecture both on device & simulator, create fat library using lipo -create -output "myLibrary.a" ./Simulator/myLibrary.a ./Device/myLibrary.a and use it.

XCode 6.1 Missing required architecture X86_64 in file for extern library

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.

an architecture missing when committing and checking out a framework

I have a project that depends on the SDWebImage framework.
I downloaded the framework, followed the instructions all is good and fine.
I Committed my project to my git repository, and then checked it out on another mac computer.
The problem - one of the architectures (i386) now missing from the SDWebImage.framework file
doing lipo -info SDWebImage.framework/SDWebImage on the original computer yields the following line
Dev1s-MacBook-Pro:Dev dev1$ lipo -info SDWebImage.framework/SDWebImage
Architectures in the fat file:
SDWebImage.framework/SDWebImage are: armv7 armv7s arm64 i386 x86_64
Yet after i checkout the file from the git repo this line reads
Architectures in the fat file:
SDWebImage.framework/SDWebImage are: armv7 armv7s arm64 x86_64
I tried manually copying the given frile from computer A to computer B, and the same thing happens.
Do you know why? and How I can fix it? as without the i386 architecture, i can't test on my iphone simulator....

file was built for archive which is not the architecture being linked (armv7s)

I'm using the new OData4ObjC framework for IOS 6, but when I try to run it keeps telling me this error.
I have followed the instructions found here https://github.com/ElizabethDuncan/OData4ObjC.
I also changed the framework to an older one to see if that is the problem. I don't know if I'm missing something.
In the future, to check what architectures a library/executable is compiled for you should use the lipo -info command. Like so:
mitchellge$ lipo -info /Users/mitchellge/Downloads/libMSODataLib.a
--> Architectures in the fat file:
/Users/mitchellge/Downloads/libMSODataLib.a are: armv6 armv7
As you can see, the library (libMSODataLib.a) that is bundled with OData4ObjC is compiled for the armv6 and armv7 architectures and not the armv7s. One fix is to go into your project's build settings and change Valid Architectures from armv7 armv7s to just armv7

Resources