iosswiftxcodealamofirealamofire-request

Alamofire Version 5.2.0 and 5.2.1 both Crash at URL Session delegate


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


Solution

  • 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