Xcode 10 Generics typealias Segmentation Fault 11 while archiving

Viewed 532

Segmentation Fault while archiving on Xcode 10

Note:

  • Xcode 10 build and run on devices and simulator working fine and in Xcode 9.4 also archiving, build, and run working fine

My code:

typealias ResponseBlock<T> = (_ sender: T) -> Void

I am using this in all over the project like:

var callback: ResponseBlock<AnyObject>? 

Error while archiving on Xcode 10:

  1. While generating Objective-C header
  2. While printing ................
  3. While printing type 'ResponseBlock<[IndexPath]>' (declared at.....] RangeText="typealias ResponseBlock = (_ sender: T) -> V")
  4. While printing type '(T)' error: Segmentation fault: 11

Usage:

var refreshCells: ResponseBlock<[IndexPath]>?
viewModel.refreshCells = {indexPathList in 
     self.collectionView.reloadItems(at:   indexPathList)
}
2 Answers

I noticed XCODE 10 Archive is on release mode and build, run is on Debug mode.

So I checked the difference between Release and Debug mode configuration

Findings: enter image description here

Solution: enter image description here

It Solved my problem, now no longer receiving Segmentation Fault.

Setting the Build system to use the legacy build system worked for me:

File > Workspace Settings

Setting build system

Related