Error Domain=CoreMediaErrorDomain Code=-16657

After upgrading to iOS 14.4, I am getting always download failure for HLS (FairPlaycontent), with below error code:

Error Domain=CoreMediaErrorDomain Code=-16657 "(null)" UserInfo={_NSURLErrorRelatedURLSessionTaskErrorKey=(
"BackgroundAVAssetDownloadTask <3D18A797-87AA-467D-956B-52FA335FD028>.<1>"
), _NSURLErrorFailingURLSessionTaskErrorKey=BackgroundAVAssetDownloadTask <3D18A797-87AA-467D-956B-52FA335FD028>.<1>}

When I pause and resume, and when download progress reaches at 100%, suddenly, it fails with CoreMediaErrorDomain Code=-16657
Does anyone has faced this issue..?
Answered by mgy in 666327022
I have exactly the same problem with the same error message. I posted on Stackoverflow too. https://stackoverflow.com/questions/66600288/avaggregateassetdownloadtask-error-domain-coremediaerrordomain-code-16657

Technical Details
Xcode Version 12.4 (12D4e)
iOS Version 14.4

Any solution on this?
Accepted Answer
I have exactly the same problem with the same error message. I posted on Stackoverflow too. https://stackoverflow.com/questions/66600288/avaggregateassetdownloadtask-error-domain-coremediaerrordomain-code-16657

Technical Details
Xcode Version 12.4 (12D4e)
iOS Version 14.4

Any solution on this?
Accepted Answer
Hi, I reported a bug

FB9043262


Best.

Muhammed Gurhan Yerlikaya
@mgy I updated to iOS 14.5 beta 3, It works fine for some of the assets, May be apple will fix this issue in upcoming iOS release.
Hi @mritunjay,

in some of my tests, it successfully downloaded after suspend/resume on iOS 14.4 too.

The test screen and the scenario are so simple, and the same actually. But, even for the same file, it's changing from time to time. This is my suspend and the resume methods:

Code Block swift
/// Pauses an AVAssetDownloadTask via given productId.
    /// - Parameter productId: The productId.
    @objc public func pauseDownload(for productId: String) {
        var asset: Asset?
        var task: AVAggregateAssetDownloadTask?
        for (taskKey, assetValue) in activeDownloadsMap where productId == assetValue.productId {
            asset = assetValue
            task = taskKey
            task?.suspend()
            break
        }
        // Here: I'm sending a notification to the UI cases
    }
    
    /// Resumes an AVAssetDownloadTask via given productId.
    /// - Parameter productId: The productId.
    @objc public func resumeDownload(for productId: String) {
        var asset: Asset?
        var task: AVAggregateAssetDownloadTask?
        for (taskKey, assetValue) in activeDownloadsMap where productId == assetValue.productId {
            asset = assetValue
            task = taskKey
            task?.resume()
            break
        }
        // Here: I'm sending a notification to the UI cases
    }


Error Domain=CoreMediaErrorDomain Code=-16657
 
 
Q