I will add my 2 cents here (in a less scary way :-). I have encountered quite a number of fat libraries from Vendors that (for some reason) do not work the normal way by adding them to the Frameworks
directory as documented by Apple. The only way we have been able to make them work is by pulling the .framekwork
right into the project directory and linking the Embedded Frameworks
and Link Binary with Libraries
manually in Build Settings. This seem to have worked without any issues, however, as with any fat library they come with the extraneous Simulator Architectures i386
and x86_64
along with the arm
architectures.
A quick way to check the architectures on the fat library is
$ cd 'Project_dir/Project'
$ lipo -info 'YourLibrary.framework/YourLibExec`
Which should spit an output something like this
Architectures in the fat file: YourLibrary.framework/YourLibExec are: i386 x86_64 armv7 arm64
This confirms that you will need to "trim the fat" (namely i386
& x86_64
) from your framework prior to iTunesConnect Archival upload, which doesn't allow these architectures (since they are unsupported for iOS).
Now, all the answers (or atleast some of the answers) here provide these wonderful Run Scripts that I am sure works really well, but only if your Framework resides in the Frameworks
directory. Now unless you are a shell script junkie, those scripts without modifications, won't work for the scenario I explain above. However, there is a very simple way to get rid of the i386
& x86_64
architectures from the framework.
Open terminal in your project's directory.
Change directory directly into the .framekwork
, like
cd YourProjectDir/YourProject/YourLibrary.framework
Run the series of commands as shown below-
$ mv YourLibrary YourLibrary_all_archs
$ lipo -remove x86_64 YourLibrary_all_archs -o YourLibrary_some_archs
$ lipo -remove i386 YourLibrary_some_archs -o YourLibrary
$ rm YourLibrary_all_archs YourLibrary_some_archs
A few things to note here - lipo -remove
has to be done once for each architecture to remove. lipo
does not modify the input file, it only produces a file so you have to run lipo -remove
once for x86_64
and i386
. The commands above is simply doing that by first renaming the executable and then eventually removing the desired archs, and then cleaning up the left over files. And that's it, you should now see a green check mark in Application Loader Archival upload to iTunesConnect.
Things to keep in mind : The above steps should only be done while production build, since the .framework
will be stripped off the simulator architectures, builds on simulators will stop working (which is expected). In development environment, there should be no need to strip the architectures off of the .framework
file since you want to be able to test on both Simulator and a physical device. If your fat library resides in the Frameworks
folder in the project then please look at the accepted answer.