1

I am using latest alamofire version 5.2.1 to make WEB API calls it working perfect with all apis But when i call api for country list it crash at URL Session Delegate class

 open func urlSession(_ session: URLSession, dataTask: URLSessionDataTask, didReceive data: Data) {
        eventMonitor?.urlSession(session, dataTask: dataTask, didReceive: data)

        if let request = request(for: dataTask, as: DataRequest.self) {
            request.didReceive(data: data)
        } else if let request = request(for: dataTask, as: DataStreamRequest.self) { //Crash at this line
            request.didReceive(data: data)
        } else {
            assertionFailure("dataTask did not find DataRequest or DataStreamRequest in didReceive")
            return
        }
    }

The same request works perfect with normal url session and postman only alamofire cannot handle the response i am attaching screen shot for more detail.

Response contains 2000 line json but i don't think that's the problem

enter image description here

Jaydeep Vyas
  • 4,411
  • 1
  • 18
  • 44

1 Answers1

1

Hello this issue already reported on Alamofire

Contributor said this issue was fixed by moving to Xcode 11.4.1

Please check this

https://github.com/Alamofire/Alamofire/issues/3163

Cruz
  • 2,602
  • 19
  • 29
  • yes so basically alamofire lib is not compatible with xcode 11.1 – Jaydeep Vyas Jun 13 '20 at 14:45
  • It is, Swift 5.1 and 5.2 just have a variety of runtime crashes that Alamofire may hit. Keeping your Xcode up to date should give you the highest chance of avoiding those crashes. – Jon Shier Jun 15 '20 at 14:20