Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 10 Generics typealias Segmentation Fault 11 while archiving

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)
}
like image 581
Muhammad Zain ul Abdeen Avatar asked Oct 22 '18 04:10

Muhammad Zain ul Abdeen


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.

like image 143
Muhammad Zain ul Abdeen Avatar answered Oct 19 '22 13:10

Muhammad Zain ul Abdeen


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

File > Workspace Settings

Setting build system

like image 1
Frederik Voordeckers Avatar answered Oct 19 '22 11:10

Frederik Voordeckers