xcode 5 存档构建失败,但正常构建成功

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

xcode 5 archive build fail, but normal build successfully

iosxcodebuildipa

提问by Arton

I can build and run my app on my device, but when I tried to build archive, I got many errors. The errors are about my 3rd library - google protobuf. It showed that #error Host architecture was not detected as supported by protobuf. But what is the difference between archieve and normal build?? After all, I built successfully and ran my app on the device when I choose product=>run (cmd+R).

我可以在我的设备上构建和运行我的应用程序,但是当我尝试构建存档时,我遇到了很多错误。错误是关于我的第三个库 - google protobuf。它表明未检测到 protobuf 支持的 #error Host 架构。但是archieve和普通构建有什么区别??毕竟,当我选择 product=>run (cmd+R) 时,我成功构建并在设备上运行了我的应用程序。

回答by Rhythmic Fistman

When you build to run, Xcode usually builds for the active architecture only. When you archive it builds all the architectures specified by the intersection of the Build Settings "Architectures and Valid Architectures".

当您构建运行时,Xcode 通常只为活动架构构建。当您存档时,它会构建由构建设置“体系结构和有效体系结构”的交集指定的所有体系结构。

So it's likely that Xcode is trying to build for some architecture that isn't supported by your protobuf library, e.g. Arm64.

因此,很可能 Xcode 正在尝试为您的 protobuf 库不支持的某些架构构建,例如 Arm64。

回答by Itay Bianco

For me the problem was that the scheme for "Archive" was different than the scheme for "Run". When i switched "Archive" to use DEBUG instead of RELEASE it worked.

对我来说,问题是“存档”的方案与“运行”的方案不同。当我将“存档”切换为使用 DEBUG 而不是 RELEASE 时,它起作用了。

回答by Himanshu padia

You can see reasons for failure in Report Navigator present in Navigator window.

您可以在“导航器”窗口中的“报告导航器”中查看失败的原因。

Menu -> View -> Navigator -> Hide/Show Navigator

Extra icon will appear/disappear next to Breakpointicon after Hide/Show Navigator

额外的图标将出现/消失在Breakpoint图标旁边Hide/Show Navigator

Open Report Navigatorby pressing last button present on list of buttons in Navigator window.

打开Report Navigator按一次出现在导航器窗口的按钮列表按钮。

Here you can view reasons either By Groupor By Time.

您可以在此处查看原因By GroupBy Time.