2

When I archive project for the App Store, I have an error Segmentation fault 11 1. While running pass #317780 SILFunctionTransform ""Combine SIL

Instructions via Peephole Optimization"" on SILFunction "@_T08myapp20ItchMessageViewModelC05photoC0AA0bcE8Protocol_pfgAA04ChatbcE0C_Tg5".
for getter for photoMessage at /Users/work/Desktop/myappProject/myappiOS/myapp/Groups/ChatGroup/ChatFactory/Bubbles/VideoBubble/Model/ItchMessageViewModel.swift:38:16

This code looks like this

open class ItchMessageViewModel<ItchMessageModelT: ItchMessageModelProtocol>: ItchMessageViewModelProtocol {

    public var itchID: String
    public var itchName: String

    public var photoMessage: ItchMessageModelProtocol { **This is 38 line**
        return self._itchMessage
    }

    public let _itchMessage: ItchMessageModelT
    public var transferStatus: Observable<TransferStatus> = Observable(.idle)
    public var transferProgress: Observable<Double> = Observable(0)
    public var transferDirection: Observable<TransferDirection> = Observable(.download)
    public var image: Observable<UIImage?>
    open var imageSize: CGSize {
        return self.photoMessage.imageSize
    }
    public let messageViewModel: MessageViewModelProtocol
    open var showsFailedIcon: Bool {
        return self.messageViewModel.showsFailedIcon || self.transferStatus.value == .failed
    }

    public init(itchMessage: ItchMessageModelT, messageViewModel: MessageViewModelProtocol) {
        self._itchMessage = itchMessage
        self.image = Observable(itchMessage.image)
        self.messageViewModel = messageViewModel
        self.itchName = itchMessage.itchName
        self.itchID = itchMessage.itchID
    }

    open func willBeShown() {
        // Need to declare empty. Otherwise subclass code won't execute (as of Xcode 7.2)
    }

    open func wasHidden() {
        // Need to declare empty. Otherwise subclass code won't execute (as of Xcode 7.2)
    }
}

But there is no build time for the device or the error simulator. How can I fix it?

Alexander Khitev
  • 6,417
  • 13
  • 59
  • 115

1 Answers1

1

I think this is not the most optimal solution, but it helped me.

In the project settings, I selected target MyApp -> Build Settings -> Optimization Level -> Release None [-Onone].

I'm thinking of creating a bug report for Apple, since this code is from the Chatto framework, and I also did not intend to.

Alexander Khitev
  • 6,417
  • 13
  • 59
  • 115