2

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.

Mark McCorkle
  • 9,349
  • 2
  • 32
  • 42

3 Answers3

7

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.

Mark McCorkle
  • 9,349
  • 2
  • 32
  • 42
  • +1 for filing a radar. I had a similar compiler optimization issue a couple years ago and the radar was what prompted the fix. – Craig Otis Oct 22 '14 at 14:01
1

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

Dayn Goodbrand
  • 611
  • 7
  • 16
  • The problem only occurs during archiving so this doesn't apply. Building to a device worked fine. – Mark McCorkle Oct 27 '14 at 12:17
  • Building to a Device worked fine for me too, but i was having this exact issue with building to the Simulator. Hopefully it helps someone else :) – Dayn Goodbrand Oct 28 '14 at 00:42
  • Also having the same problem on the simulator. Updating Deployment Target to the latest available (8.2 now) worked for me. – mccrackend Apr 02 '15 at 12:43
0

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.

stackguy
  • 113
  • 1
  • 6