文件是通用的(三个切片),但它不包含 iOS 上静态库的 (n) ARMv7-s 切片错误,无论如何要绕过?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/12402092/
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
File is universal (three slices), but it does not contain a(n) ARMv7-s slice error for static libraries on iOS, anyway to bypass?
提问by Dafna Elazazer
I upgraded Xcodeversion and when using external static libraries, I get this message:
我升级了Xcode版本,当使用外部静态库时,我收到以下消息:
ld: file is universal (3 slices) but does not contain a(n) armv7s slice: /file/location for architecture armv7s clang: error: linker command failed with exit code 1 (use -v to see invocation)
ld:文件是通用的(3 个切片)但不包含 (n) armv7s 切片:/file/location for architecture armv7s clang:错误:链接器命令失败,退出代码为 1(使用 -v 查看调用)
Is there any way to bypass this and add support to the library if the developer of the library hasn't updated their library yet?
如果库的开发人员还没有更新他们的库,有没有办法绕过这个并添加对库的支持?
回答by Nicholas
If you want to remove the support for any architecture, for example, ARMv7-sin your case, use menu Project-> Build Settings-> remove the architecture from "valid architectures".
如果要删除对任何架构的支持,例如在您的情况下是ARMv7-s,请使用菜单项目->构建设置-> 从“有效架构”中删除架构。
You can use this as a temporary solution until the library has been updated. You have to remove the architecture from your main project, not from the library.
在库更新之前,您可以将其用作临时解决方案。您必须从主项目中删除架构,而不是从库中删除。
Alternatively, you can set the flag for your debug configuration's "Build Active Architecture Only" to Yes. Leave the release configuration's "Build Active Architecture Only" to No, just so you'll get a reminder before releasing that you ought to upgrade any third-party libraries you're using.
或者,您可以将调试配置的“仅构建活动架构”的标志设置为是。将发布配置的“仅构建活动架构”保留为否,这样您会在发布之前收到提醒,提示您应该升级您正在使用的任何第三方库。
回答by Blasco73
I've simply toggled "Build Active Architecture Only" to "Yes" in the target's build settings, and it's OK now!
我只是在目标的构建设置中将“仅构建活动架构”切换为“是”,现在就可以了!
回答by Arthur Jen
Try to remove armv7s from project's "Valid architecture" to release from this issue for iOS 5.1 phone
尝试从项目的“有效架构”中删除 armv7s 以针对 iOS 5.1 手机发布此问题
回答by Ertebolle
I just posted a fix herethat would also apply in this case - basically, you do a hex find-and-replace in your external library to make it think that it's ARMv7s code. You should be able to use lipo
to break it into 3 static libraries, duplicate / modify the ARMv7 one, then use lipo
again to assemble a new library for all 4 architectures.
我刚刚在这里发布了一个也适用于这种情况的修复程序- 基本上,您在外部库中执行十六进制查找和替换,使其认为它是 ARMv7s 代码。您应该能够将lipo
其分解为 3 个静态库,复制/修改 ARMv7 一个,然后lipo
再次使用为所有 4 个体系结构组装一个新库。
回答by RAZ
Flurry Support for iPhone 5 (ARMv7s) As I mentioned in yesterday's post, Flurry started working on a version of the iOS SDK to support the ARMv7s processor in the new iPhone 5 immediately after the announcement on Wednesday.
Flurry 支持 iPhone 5 (ARMv7s) 正如我在昨天的帖子中提到的,Flurry 在周三宣布后立即开始开发 iOS SDK 的一个版本,以支持新 iPhone 5 中的 ARMv7s 处理器。
I am happy to tell you that the work is done and the SDK is now available on the site.
我很高兴地告诉您,工作已经完成,现在可以在网站上使用 SDK。
回答by Panky
use menu Project -> Build Settings ->
使用菜单 Project -> Build Settings ->
then remove armv7s from the"valid architectures". If standard has been chosen then delete that and then add armv7.
再从“有效架构”删除armv7s。如果选择了标准,则删除该标准,然后添加 armv7。
回答by Raphael Ayres
In case this happens to someone. I built my own library to use with a third party code. While I was building it to deliver, I accidentally left my iPhone 4S plugged in, and so Xcode built my library only for the plugged architecture instead of following the project settings. Remove any plugged in devices and rebuilt the library, link it, and you should be all right.
万一这发生在某人身上。我构建了自己的库以与第三方代码一起使用。在我构建它以交付时,我不小心让我的 iPhone 4S 插入了电源,因此 Xcode 仅为插入的架构构建了我的库,而不是遵循项目设置。删除所有插入的设备并重建库,链接它,你应该没问题。
Hope it helps.
希望能帮助到你。
回答by Jay Imerman
In my case, I was linking to a third-party library that was a bit old (developed for iOS 6, on XCode 5 / iOS 7). Therefore, I had to update the third-party library, do a Clean and Build, and it now builds successfully.
就我而言,我链接到了一个有点旧的第三方库(为 iOS 6 开发,在 XCode 5 / iOS 7 上)。因此,我不得不更新第三方库,进行清理和构建,现在构建成功。