"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?

Accepted Reply

Confirmed: This has been fixed in iOS 13.4 GM.

Replies

Testing my app, everytime the app is backgrounded this warning logs out.


I dk why they insist on logging out all these cockoo warnings recently. Warning, don't refresh a table view. Warning, don't background your app. Warning, constraints broken when displaying a UIAlertController as an action sheet. Makes me want to cry.

I'm also experiencing this problem and wonder if it may be associated with another bug that I've reported to Apple:


While testing and receiving this "Can't end BackgroundTask" message on an iPad, the "recently used" part of the iPad dock is populated, as expected, with my app's icon. Problem is, that icon is non-responsive to re-activate the app, yet the main screen icon works as expected, activating the app from the background. I can not detect ANY notifications or calls to the app from the dead icon in the dock.


I question how many of us experiencing the backgrounding message are ALSO seeing this dock problem. In online researching, it appears the "dead icon" problem in the iOS 13 dock is occurring in apps delivered to customers too... something I'd really like to try to avoid.

Same problem with new single app project, when switch the app:


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


iPhone 8 Plus (GSM) (iOS 13.1.3)

Xcode 11.1 (11A1027)

Swift 5

macOS Catalina 10.15

Hi,


Same problem here also.


iPhone 7 (iOS 13.1.3)

Xcode 11.1 (11A1027)

Swift 5

macOS Catalina 10.15 (mac Mini late 2014)

Same problem on iOS 13.2 !!!

I had seen others saying this was resolved with 13.2, but that was not my experience. But, there's the thing -- the app only occaisionally crashes after this error.

Still occurring for me on iOS 13.2 as well.

And also occurring on 13.2.1. This is unbelievable.

HI!
I can confirm that, for me have also same issue with AVCaptureSession, the App is 10y+ old, but i think
doesen't matter how old, the AVCaptureSession is stopping.
"Can't end BackgroundTask: no background task exists with identifier 13 (0xd), or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug."

Update your IOS to 13.2.2, Apple say it's fixed on 13.2.2.

Nope.
Still the same in iOS 13.2.2.

the same for e

I did try using as Apple says: "Extending Your App's Background Execution Time" in Apple docs. but no way.

Same with iOS 13.3 beta and Xcode 11.2.1 GM 11B53. the interesting thing is the identifier number changes over the course of sending my app to the background and reawakening it...

Correct. The ID increases every time the app is sent to background and the message appears. Besides this ... is your background code still executed? I use background fetch, and I didn't see any content update for the last 12 hours, which is not normal.

My app still functions correctly (so far as it is implemented - I haven't completed the code in the background thread yet). I can add a quick and dirty test, though, to see if the error is correct and the thread is running or not.