Can't archive working 6.0.1 Swift project in Xcode 6.1 / Segmentation fault: 11

[亡魂溺海] 提交于 2019-12-02 05:59:06

问题


Command failed due to signal: Segmentation fault: 11 While type-checking expression at [/Users/thedude/Documents/Repositories/MyProject/Data.swift:258:36 - line:258:56] RangeText="UILocalNotification()"

The error is referring to the following line of code.

var notification = UILocalNotification()
// also tried var notification:UILocalNotification = UILocalNotification()

The problem only occurs when archiving (to submit to store). If I comment out that line of code the error will just appear in other random locations until I eventually have a project that is pretty useless.

This is another example of what appears after commenting out the previous code mentioned.

var someDate:NSDate = self.datePicker.date

And so on... The REALLY strange part is this project compiles and builds totally fine on the device. This only happens when building for ARCHIVE. I have set the Swift Compiler Optimization Level to None to see if that was the cause to no avail.


回答1:


Although it is not the solution I would hope for I did discover if I set the Swift Compiler Optimization Level to Fastest, Unchecked [-Ounchecked] I am able to at least archive and submit my build.

I am assuming this is an Xcode 6.1 (release) specific issue and have filed a bug report.




回答2:


Changing your Deployment Target to 8.1 fixes this for me. I haven't tested Archiving but works for the Simulator.




回答3:


I had the same issue on Xcode 6.1. Building and running the Swift project was no problem, archiving led to an error:

Command failed due to signal: Segmentation fault: 11
1.  While type-checking <my Swift class>

Changing the project's Deployment Target from 7.0 to 7.1 solved the problem, the app can now be archived.



来源:https://stackoverflow.com/questions/26508911/cant-archive-working-6-0-1-swift-project-in-xcode-6-1-segmentation-fault-11

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