swift 编译打包错误汇总


1.swiftc failed with exit code 1

archive时,将schema设置成release,无法编译通过,报错如下
Command /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swiftc failed with exit code 1

解决方案:将"Optimization Level"设为“None”,设置路径:Target > Build Settings > Swift Compiler > Optimization Level.


2.当项目从xcode beta 1切换beta 5报各种编译错误,可尝试清除~/Library/Developer/Xcode/DerivedData目录下的对应项目


3.在接入Mob短信验证SMS SDK时,第一次编译正常,关掉xcode后再次编译报 /BridingHeader.h:13:9: 'SMS_SDK/SMS_SDK.h' file not found 错误。原因是 FrameWork Search Paths 中SDK路径还有空格导致,追根溯源,是下载下来的SDK zip文件名带空格,mac下解压缩默认就用文件名做目录名,所以也带空格了。


4.升级到xcode7.1后重新编译报 Command failed due to signal: Segmentation fault: 11 错误

解决方案:

@objc protocol ChatInputDelegate:NSObjectProtocol
{
    optional func chatInput(input:ChatInput, frameChange frame:CGRect)

}

delegate?.chatInput?(self, frameChange: targetRect)

改为

@objc protocol ChatInputDelegate:NSObjectProtocol
{
    func chatInput(input:ChatInput, frameChange frame:CGRect)

}

delegate?.chatInput(self, frameChange: targetRect)




你可能感兴趣的:(swift,swift,ios)