an architecture missing when committing and checking out a framework - ios

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....

Related

What architecture should it be my .a for running on iOS Device and iOS Simulator

I have build a fat library with the architectures "arm64", "armv7" and "x86" from various lib.a. I have no problem when I compile the project for iOS Devices but it seems the compilation goes wrong when I try it into a iOS simulator. It says "Undefined Symbols for x86_64". I can Imagine that I need also the x86_64 lib.a But I wonder what can I do for solving the problem.
Note:
The libraries where manually compiled from OpenHome
Than you
Edited:
Could be because of the makefile from Here
As a first step, make sure if your fat bin definitely includes x86_64.
To do so, you can check w/ cmd as follows.
$ xcrun lipo -info yourLibrary.a
If your lib definitely contains x86_64, it should show
Architectures in the fat file: yourLibrary.a are: x86_64 arm64 ...
For example, I have compiled libpng for x86_64 and arm64 for my app. The xcrun command shows as follow.
$ xcrun lipo -info libpng.a
Architectures in the fat file: libpng.a are: x86_64 arm64
Needless to say, fat bin has both arm64 and x86 (since it's FAT). So fat bin doesn't require separate x86_64 lib.a as you mentioned in you q.
Checking your Makefile is after you confirmed your fat bin has x86_64.

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.

missing required architecture x86_64 in file

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

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