xcode在打包应用时出现的错误汇总如下:
点击Archive-》Validate时出现错误或者警告
1. 出现错误
this bundle is invalid when supporting iPhone,the executable must include support for the armv6 architecture,unless the UIRequireDeviceCapabilities include the 'armv7' capability
解决方法:如下图
在Build Setting中设置Architectures为armv6 armv7,Valid Architectures为armv7。具体设置方法如下:
点击Other然后添加armv6和armv7,如下图
2. 出现警告
the app references non-public selectors in Payload/xxxx.app/xxxx:layerNames
注:xxxx为应用的名字,layerNames为出错的一个方法
解决方法:在xcode工程中搜索layerNames这个方法(也可以是其他的方法),看看是否是苹果的private方法或者有重复的文件包含了这个方法,删除掉重复的文件即可,然后重新打包。
3.出现警告
[WARN]Warning: Multiple build commands for output file /xxx
原因: 在xcode的资源里面包含了重复的文件解决方法:
(1).选择你的工程
(2).选择target
(3).点击 Build Phases
(4).展开Copy Bundle Resources
(5).删除里面的刚才提示警告的文件,一般为红色的名字的文件(如果找不到,可以在搜索框中搜索该资源的名字)