Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

KingFisher 5.0 crashing with EXC_BAD_INSTRUCTION in Xcode 11.2

I got Xcode 11.2 (beta and stable releases) since I updated iOS to 13.2. I have been using KingFisher with no errors and Suddenly it crashes with the error Thread 1: EXC_BAD_INSTRUCTION (code=1, subcode=0x210007) in ImageDownloader line 169:


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

The culprit is this line of code in tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath):


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

the value in: self.datasource[indexPath.row].imageUrl is http://sgfm.elcorteingles.es/SGFM/dctm/MEDIA03/201811/26/00118105700068____2__40x40.jpg

The KingFisher 5 Migration guide says that this should work. What am I doing wrong?

UPDATE: A working (crashing) concept can be found at: https://github.com/juanjoseluisgarcia/kignfishertest.git

like image 839
Juanjo Avatar asked Jan 26 '23 16:01

Juanjo


1 Answers

UPDATE: As per twitter the solution to this and similar problems with Swift Package Manager in Xcode 11.2 is to go to the target, "Linker settings" and change "Dead Code Stripping" to NO

There is an open issue in Github. The issue is around the Package Manager in Xcode 11.2 They will need to update the linker for the Package Manager.

like image 50
Juanjo Avatar answered Mar 16 '23 02:03

Juanjo