Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nw_read_request_report Receive failed with error "Software caused connection abort"

Tags:

xcode

firebase

I don't know if anyone else is getting these messages, but I get these messages in the logs when the app goes into the background, then comes back:

[] nw_read_request_report [C3] Receive failed with error "Software caused connection abort"

Followed by:

Could not signal service com.apple.WebKit.WebContent: 113: Could not find specified service

This is coming after many other bad logs, like:

  • [Process] kill() returned unexpected error 1 AND ProcessAssertion::processAssertionWasInvalidated()
  • Can't end BackgroundTask: no background task exists with identifier *, or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.

My project has Firebase, which could be a source of all the web-related logs.

What could be causing it? Is it a bug?


Update

I removed errors from bullet no.1, written in my answer here.

like image 201
George Avatar asked Jan 06 '20 18:01

George


Video Answer


2 Answers

I had these errors. They were caused by my failure to call invalidateAndCancel on a NSURLSession.

like image 60
Peter B. Kramer Avatar answered Sep 17 '22 13:09

Peter B. Kramer


This is somewhat related, and hope it helps someone. My situation was that the openURL extra function provided in the SceneDelegate was not being called after returning from Facebook Authentication.

The solution was using

.onOpenURL { (url) in
                ApplicationDelegate.shared.application(
                    UIApplication.shared,
                    open: url,
                    sourceApplication: nil,
                    annotation: [UIApplication.OpenURLOptionsKey.annotation]
                )
            }

On a view in the Scene instance, like so:

var body: some Scene {
    WindowGroup {
        LoadingView()
            .onOpenURL { (url) in
                ApplicationDelegate.shared.application(
                    UIApplication.shared,
                    open: url,
                    sourceApplication: nil,
                    annotation: [UIApplication.OpenURLOptionsKey.annotation]
                )
            }
    }
}

This then calls the function in my extra application delegate, which then dismissed the login screen properly.

like image 27
Jprofficial Avatar answered Sep 18 '22 13:09

Jprofficial