xcode 5 archive build fail, but normal build successfully

試著忘記壹切 提交于 2019-11-30 13:00:02

问题


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).


回答1:


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".

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




回答2:


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.




回答3:


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 Breakpoint icon after Hide/Show Navigator

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

Here you can view reasons either By Group or By Time.



来源:https://stackoverflow.com/questions/20371521/xcode-5-archive-build-fail-but-normal-build-successfully

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!