ios xcode 5.1 中的 Arm64 架构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/22323039/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-30 23:41:24  来源:igfitidea点击:

Arm64 architecture in xcode 5.1

iosobjective-cxcodexcode5.1

提问by MrJre

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

在新的 XCode 5.1 中,arm64 已成为构建的标准架构之一。

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:

但是,在我当前的项目中,我包含了尚不支持这种新架构的库(例如 Google AdMob)——这些现在会导致链接器错误:

ld: symbol(s) not found for architecture arm64

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

例如,据说Google AdMob 6.8.0支持 arm64,但我无法确认这一点,除非cputype (16777228) cpusubtype (0)是 arm64?(通过文件命令行工具找到)

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?

有没有办法解决这个问题?

回答by M. Porooshani

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

暂时摆脱arm64并不难。您需要做的就是:

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

  • Edit the value Valid Architecturesand simply remove the arm64part of it.

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

  • 编辑目标构建设置Architectures通过打开下拉列表更改值,单击其他...并选择它,删除带有值的行$(ARCHS_STANDARD)并添加带有值的两行:armv7armv7s(或$(ARCHS_STANDARD_32_BIT)nschum 所述),关闭弹出窗口。

  • 编辑值Valid Architectures并简单地删除arm64它的一部分。

  • 为您的工作区或项目中可能拥有的每个嵌套项目执行此操作。

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.

注意:这不是解决方案,它只是缓解您当前问题的几个步骤,请继续关注您的依赖项目,以了解它们何时与 arm64 兼容并尽快恢复这些设置的更改。

Good luck

祝你好运

回答by jsherk

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.

从 Xcode 5.1 开始,$(ARCHS_STANDARD) 现在包括 arm64(以及 armv7 和 armv7s),而在 Xcode 5.02 中,$(ARCHS_STANDARD) 只包括 armv7 和 armv7s。

For Xcode 5.1

对于 Xcode 5.1

$(ARCHS_STANDARD) = armv7 armv7s arm64

$(ARCHS_STANDARD) = armv7 armv7s arm64

$(ARCHS_STANDARD_32_BIT) = armv7 armv7s

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

因此,如果您必须以 64 位编译,那么您需要确保所有包含的库都具有 64 位切片。如果他们还不支持 64 位,那么你将不得不在 32 位编译。

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.

但无论哪种情况,在目标构建设置下,您都需要确保 Achitectures 和 Valid Achitectures 设置相同且匹配(见下图)。所以你可以用 $(ARCHS_STANDARD) 尝试它们,如果它不能编译,那么你可以用 $(ARCHS_STANDARD_32_BIT) 尝试它们,理论上这将消除错误并编译一个工作项目。

-

——

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

对于带有 arm64 armv7s 和 armv7 的 64 位,像这样:

enter image description here

在此处输入图片说明

-

——

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

或者对于只有 armv7s 和 armv7(没有 arm64)的 32 位来说,像这样:

enter image description here

在此处输入图片说明

回答by karlbecker_com

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

在目标的构建设置中,将“有效架构”更改为仅支持的架构;在这种情况下可能是 armv7 和 armv7s。

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.

如果您使用 Cocoapods,请确保为 Pods 项目中的所有目标更改此设置,并将所有这些目标的“仅构建活动架构”设置为所有方案的“否”。

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

此处详细介绍了对 podfile 的一个小更改,以自动从 cocoapods 目标中删除 64 位构建架构:http: //cameronspickert.com/2014/01/20/remove-the-arm64-architecture-from-cocoapods-targets

回答by Agnit

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

在 XCode 5.1上将架构设置为$(ARCHS_STANDARD_32_BIT)有效。无需从有效架构中删除arm64

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.

体系结构指定要构建的实际体系结构,并会忽略有效体系结构(指定超集)中的 arm64 条目。希望苹果尽快解决这个问题。

回答by RawMean

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

我有同样的错误。下载新版本的 Google AdMob SDK 6.8.0 解决了这个问题。这是链接:https: //developers.google.com/mobile-ads-sdk/download#downloadios

So, disabling the arm64 architecture is not necessary.

因此,没有必要禁用 arm64 架构。

回答by Almas Adilbek

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

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

没有一个答案对我有用。
我终于提交了我的应用程序,除了 Xcode 5.1 之外,还安装了旧的Xcode 5.0.2
使用这个版本的 Xcode 来存档应用程序,没有错误。在此处

下载旧版Xcode 5.0.2(您必须使用您的 Apple ID 登录):