ios静态库开发中的那些坑

来源:互联网 发布:linux优化 编辑:程序博客网 时间:2024/05/03 10:56

最近开发静态库的时候,在自己这边真机和模拟器编译的时候好好的,一到客户那边就编译不了。经研究,原来是将“Build Active Architecture Only”设置成了YES,如果设置成YES,编译出来的库只能支持与自己真机或当前模拟器相同的架构,一到别人那边可能就不能编译了。


The issue is that the cocoapods have not been built for arm64 architecture yet thus they cannot be linked when you build them. Likely you cannot use those packages until they are updated and use that architecture. You can fix the linker error by going to project -> target (your project name) -> build settings and change architectures to standard architectures (armv7, armv7s), and valid architectures to armv7, armv7s.

Note though, this means you won't get the full power of the 64 bit processor. You said you are building for the 5s, so there may be some reason you need this. If you for some reason absolutely need that power (perhaps you are building a game), and desperately need those files, you could submit a pull request and then recompile the project to arm64 by setting those same fields to arm64 in the files you pulled from the open source projects. But, unless you really need these files to be 64 bit compatible, that seems like a bit of overkill for now.

EDIT: Some people also reported that setting Build For Active Architectures to YES was also necessary to solve this problem.

**********************

解决了我的问题

ARCHS = armv7 armv7s

VALID_ARCHS = armv6 armv7 armv7s arm64

本文转载至 http://blog.csdn.net/forlong401/article/details/20059841

用Xcode提交市场的时候,报如下的错误:

ERROR ITMS-9000: "this bundle is invalid. armv7s are required to include armv7 architecture." at SoftwareAssets/SoftwareAsset (MZItmspSoftwareAssetPackage)

解决方法:

找到项目配置的架构Architecture部分,将“Build Active Architecture Only”里的Release设置为No(如果不是no的话,当你开着模拟器或者插着手机的时候,就只编译当前的cpu架构的版本),如图所示:


用xcode开发的库,默认都是动态库,而appStore又不允许上传动态库,因此上传的时候,需要将动态库转换为静态库,转换方法:


0 0
原创粉丝点击