Xcode 7 command failed due to signal: illegal instruction 4

时间秒杀一切 提交于 2019-12-01 04:07:10

So an answer was found thanks to the help of a coworker. We found the offending file in the build error, but there was no line provided. Through process of elimination, we found it to be a line that was declaring a new constant to the result of getting a JSON dictionary ([String : AnyObject], typealiased to JSONDictionary), from inside an optional dictionary. Here is the line:

let objectsDictionary = maybeJSON?[key] as? JSONDictionary

Changed this to two guard statements:

guard let goodJSON = maybeJSON as? JSONDictionary else { return ... }
guard let objectsDictionary = goodJSON[key] as? JSONDictionary else { return ... }

This line worked in Xcode 6.3.2 as it would just provide an optional value, but for some reason, some change in Xcode 7 didn't like this. I hope this can help anyone else who runs across this.

'Illegal instruction' simply means that your binary contains instructions that are invalid for the type of architecture you are trying to run the code with. Start looking at the minimum version in your project build settings.

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