"Can't end BackgroundTask" error message on iOS 13.0

I made new project on Xcode 11 beta 7 and just run app on simulator and go back to home screen.

Then debugger shows the message below, although I didn't implement codes related background task.


Can't end BackgroundTask: no background task exists with identifier 1 (0x1), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.


Has anyone else experienced this problem?

Answered by billylo in 412345022

Confirmed: This has been fixed in iOS 13.4 GM.

I'm having the same problem. Current OS and lastest version of Xcode.

I've the same issue in IOS 13.3. This warning message annoyed.

Same with iOS 13.3 and Xcode 11 with new single application project.

Same Issue still exist:
Xcode: 11.3.1

iPhone x: 13.3

When will Apple provide a fix or a workaround for this?!

Same Issue still exist:
Xcode: 11.3.1

iPhone x: 13.3


When will Apple provide a fix or a workaround for this? 😢

This seems to be a bug that will be fixed in ios 13.4. Here's the thread where I found the information (go to the last post of the thread):


https://github.com/firebase/firebase-ios-sdk/issues/4554

This bug still exist in iOS 13.4, can some one help me fix if any one have work around for

below is the details :

iOS 13.4 Bug: When app goto background from foreground while fetching data from server network is getting disconnect


Steps to reproduce:

  1. Create a new app and call any API to the server to get data
  2. immediately take the app to background
  3. network get disconnects

below is the log:

2020-03-26 17:21:00.894598+0530 TestApp[783:152843] Connection 2: received failure notification

2020-03-26 17:21:00.895805+0530 TestApp[783:152843] Connection 2: failed to connect 1:53, reason -1

2020-03-26 17:21:00.895895+0530 TestApp[783:152843] Connection 2: encountered error(1:53)

2020-03-26 17:21:00.901375+0530 TestApp[783:152843] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> HTTP load failed, 0/0 bytes (error code: -1005 [1:53])

2020-03-26 17:21:00.901831+0530 TestApp[783:152843] Connection 1: received failure notification

2020-03-26 17:21:00.902078+0530 TestApp[783:152843] [] nw_flow_add_write_request [C1.1 40.85.185.46:443 failed channel-flow (satisfied (Path is satisfied), interface: en0, ipv4, dns)] cannot accept write requests

2020-03-26 17:21:00.902200+0530 TestApp[783:152843] [] nw_write_request_report [C1] Send failed with error "Socket is not connected"

2020-03-26 17:21:00.905902+0530 TestApp[783:152870] Task <36B9553A-99F2-42FE-8650-A5E5155EFCFD>.<1> finished with error [-1005] Error Domain=NSURLErrorDomain Code=-1005 "The network connection was lost." UserInfo={NSUnderlyingError=0x2824734e0 {Error Domain=kCFErrorDomainCFNetwork Code=-1005 "(null)" UserInfo={_kCFStreamErrorCodeKey=53, _kCFStreamErrorDomainKey=1}}, NSErrorFailingURLStringKey=https://api.server.account, NSErrorFailingURLKey=https://api.server.account, _kCFStreamErrorDomainKey=1, _kCFStreamErrorCodeKey=53, NSLocalizedDescription=The network connection was lost.}

Accepted Answer

Confirmed: This has been fixed in iOS 13.4 GM.

This issue still not fixed. I created a framework in which I am submitting the BGProcessingTaskRequest upon appdidenterbackground notification. it complains about the Error Domain=BGTaskSchedulerErrorDomain Code=1. Ironically I built a sample app without framework it works fine in the Host App and was able to run the command to test the triggering of background process.

Issue still present on ios 15.4.1 (xcode 13.3.1)

"Can't end BackgroundTask" error message on iOS 13.0
 
 
Q