Arm64 architecture in xcode 5.1

IosObjective CXcodexcode5.1

Ios Problem Overview


In the new XCode 5.1, arm64 has become among the standard architectures to build for.

However, in current projects of mine I included libraries (Google AdMob for example) that do not yet support this new architecture - these are now causing linker errors:

ld: symbol(s) not found for architecture arm64

Google AdMob 6.8.0 for example is said to be supporting arm64 but I can't really confirm this, unless cputype (16777228) cpusubtype (0) is arm64? (found through the file command-line tool)

libGoogleAdMobAds.a: Mach-O universal binary with 5 architectures
libGoogleAdMobAds.a (for architecture armv7):	current ar archive random library
libGoogleAdMobAds.a (for architecture armv7s):	current ar archive random library
libGoogleAdMobAds.a (for architecture i386):	current ar archive random library
libGoogleAdMobAds.a (for architecture x86_64):	current ar archive random library
libGoogleAdMobAds.a (for architecture cputype (16777228) cpusubtype (0)):	current ar archive random library

Is there a way to go about this?

Ios Solutions


Solution 1 - Ios

It's not that hard to get rid of arm64 for the time being. all you need to do is to:

  • Edit your target's Build Settings. Change the value for Architectures by opening the drop down, click on Other... and select it, delete the row with value $(ARCHS_STANDARD) and add two rows with values: armv7 and armv7s (or $(ARCHS_STANDARD_32_BIT) as mentioned by nschum), close the popup.

  • Edit the value Valid Architectures and simply remove the arm64 part of it.

  • Do it for every nested project you might have inside your workspace or project.

Note: This is not a solution, it's just a few steps to mitigate your current problem, please keep following your dependency projects to find out when they come with arm64 compatibility and revert these settings' change ASAP.

Good luck

Solution 2 - Ios

As of Xcode 5.1 $(ARCHS_STANDARD) now includes arm64 (as well as armv7 and armv7s) whereas with Xcode 5.02, $(ARCHS_STANDARD) only included armv7 and armv7s.

For Xcode 5.1

$(ARCHS_STANDARD) = armv7 armv7s arm64

$(ARCHS_STANDARD_32_BIT) = armv7 armv7s

So if you MUST compile in 64-bit then you need to make sure all included libraries have 64-bit slice. If they do not yet support 64-bit then you will have to compile in 32-bit instead.

But in either case, under your targets build settings you need to make sure that both the Achitectures and the Valid Achitectures are set the same and that they match (see images below). So you can try them both with $(ARCHS_STANDARD) and if it will not compile, then you can try them both with $(ARCHS_STANDARD_32_BIT) which in theory will remove the errors and compile a working project.

Like this for 64-bit with arm64 armv7s and armv7:

enter image description here

Or like this for 32-bit with armv7s and armv7 only (without arm64):

enter image description here

Solution 3 - Ios

In Build Settings for your target, change the "Valid Architectures" to only those that you support; likely armv7 and armv7s in this case.

If you are using Cocoapods, be sure to change this for all of the targets within the Pods project, and set all of those targets' "Build Active Architecture Only" to "No" for all schemes.

A small change to your podfile to automatically remove the 64-bit build architecture from your cocoapods targets is detailed here: http://cameronspickert.com/2014/01/20/remove-the-arm64-architecture-from-cocoapods-targets

Solution 4 - Ios

Setting the architecture to $(ARCHS_STANDARD_32_BIT) on XCode 5.1 works. No need to remove arm64 from valid architectures.

The Architecture specifies the actual architectures to build on and would ignore the arm64 entry in the valid architectures(which specifies the superset). Hopefully Apple fixes this soon.

Solution 5 - Ios

I had the same error. Downloading the new version of the Google AdMob SDK 6.8.0 solved the problem. Here is the link: https://developers.google.com/mobile-ads-sdk/download#downloadios

So, disabling the arm64 architecture is not necessary.

Solution 6 - Ios

None of the answers worked for me.
I finally submitted my app installing old Xcode 5.0.2 besides with Xcode 5.1
Used this version of Xcode to archive app without errors.

Download old version of Xcode 5.0.2 here (you must be logged in with your Apple ID):

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionMrJreView Question on Stackoverflow
Solution 1 - IosM. PorooshaniView Answer on Stackoverflow
Solution 2 - IosjsherkView Answer on Stackoverflow
Solution 3 - Ioskarlbecker_comView Answer on Stackoverflow
Solution 4 - IosAgnitView Answer on Stackoverflow
Solution 5 - IosRawMeanView Answer on Stackoverflow
Solution 6 - IosAlmas AdilbekView Answer on Stackoverflow