xcode Apple Mach-O 链接器错误 armv7s 和 libGoogleAdMobAds.a

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12403630/
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-09-15 01:28:37  来源:igfitidea点击:

Apple Mach-O Linker Error armv7s & libGoogleAdMobAds.a

iosxcodelinker-errorsarmv7

提问by Darren

I've just upgraded my app to run on the new iPhone5 simulator, however when I try to build it for my iPhone 4S device, I get this Apple Mach-O Liner error.

我刚刚升级了我的应用程序以在新的 iPhone5 模拟器上运行,但是当我尝试为我的 iPhone 4S 设备构建它时,我收到了这个 Apple Mach-O Liner 错误。

ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /Users/Darren/Documents/Dev stuff/My App/GoogleAdMobAdsSDKiOS-5.0.5/libGoogleAdMobAds.a for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)

ld:文件是通用的(3 个切片)但不包含 (n) armv7s 切片:/Users/Darren/Documents/Dev stuff/My App/GoogleAdMobAdsSDKiOS-5.0.5/libGoogleAdMobAds.a 架构 armv7s clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)

Can someone shed some light on what this error it and how to fix it? I am using adWhirl with AdMob.

有人可以解释一下这个错误是什么以及如何解决它吗?我正在将 adWhirl 与 AdMob 一起使用。

Thanks

谢谢

EDIT --- I am also getting this error in another project for the file libfacebook_ios_sdk.a

编辑 --- 我也在另一个项目中为文件 libfacebook_ios_sdk.a 收到此错误

采纳答案by Nicholas

The same answer as I gave in this thread:

与我在此线程中给出的答案相同:

If you want to remove the support for any architecture, try this:

如果要删除对任何架构的支持,请尝试以下操作:

Project -> Build Settings -> remove the architecture from "valid architectures"

项目 -> 构建设置 -> 从“有效架构”中删除架构

You can use this as a temporary solution until the library has been updated. You have to remove the flag from your own project.

在库更新之前,您可以将其用作临时解决方案。您必须从自己的项目中删除该标志。

回答by Jim Huang

Update to Admob 6.2.0 or later.

更新到 Admob 6.2.0 或更高版本。

See this post: http://googleadsdeveloper.blogspot.com/2012/09/migrating-to-admob-v62-for-ios.html.

请参阅此帖子:http: //googleadsdeveloper.blogspot.com/2012/09/migrating-to-admob-v62-for-ios.html

Also, include the AdSupport framework and remove the -all_load flag. You've got to use the -ObjC flag however.

此外,包括 AdSupport 框架并删除 -all_load 标志。但是,您必须使用 -ObjC 标志。

This works for me, finally!!

这对我有用,终于!

回答by Vince Yuan

iPhone5's cpu is A6(armv7s). The existing Admob sdk does not support it. We have to wait for admob to update the sdk.

iPhone5的cpu是A6(armv7s)。现有的 Admob sdk 不支持它。我们必须等待admob 更新sdk。

回答by sprhawk

Try this:

尝试这个:

This article copy an armv7 lib code as an armv7s and build into the original lib. so xcode will see that lib has an armv7s code/arch

本文将一段 armv7 lib 代码复制为 armv7s 并构建到原始 lib 中。所以 xcode 会看到 lib 有一个 armv7s 代码/arch

http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/

http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/