KingFisher 5.0 在 Xcode 11.2 中因 EXC_BAD_INSTRUCTION 崩溃

KingFisher 5.0 crashing with EXC_BAD_INSTRUCTION in Xcode 11.2

自从我将 iOS 更新到 13.2 后,我得到了 Xcode 11.2(测试版和稳定版)。我一直在使用 KingFisher,没有任何错误,但突然崩溃,并在 ImageDownloader 行 169 中出现错误 Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x210007)


sessionDelegate.onReceiveSessionChallenge.delegate(on: self) { (self, invoke) in
            self.authenticationChallengeResponder?.downloader(self, didReceive: invoke.1, completionHandler: invoke.2)
        }

罪魁祸首是tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)中的这行代码:


cell.productImageView.kf.setImage(with: self.datasource[indexPath.row].imageUrl)

self.datasource[indexPath.row].imageUrl 中的值是 http://sgfm.elcorteingles.es/SGFM/dctm/MEDIA03/201811/26/00118105700068____2__40x40.jpg

KingFisher 5 Migration guide 说这应该有效。我做错了什么?

更新: 可以在以下位置找到工作(崩溃)概念:https://github.com/juanjoseluisgarcia/kignfishertest.git

更新: As per twitter Xcode 11.2 中 Swift 包管理器对这个问题和类似问题的解决方案是转到 target, "Linker settings" 并将 "Dead Code Stripping" 更改为 NO

Github中有一个open issue。问题出在 Xcode 11.2 中的包管理器,他们需要更新包管理器的链接器。