Break in UIApplicationEndBackgroundTaskError() to debug

Hello,


I get this message in console few seconds after I press Home button and app goes to background:


Can't endBackgroundTask: no background task exists with identifier 20, or it may have already been ended. Break in UIApplicationEndBackgroundTaskError() to debug.


I have two questions:


1. I don't have any background tasks implemented, can this come from some 3rd party library such as Google Analytics or Fabric for example?


2. How do I "Break in UIApplicationEndBackgroundTaskError() to debug" to find out more about it? Where is it, how to do it? I don't see any docs for this UIApplicationEndBackgroundTaskError() function.


Edit: Also, it seems that this is happening only in simulator, but not when runned on device.


Edit2: It looks like it's coming from Fabric and TwitterKit.


Thanks,

// T

Accepted Reply

1. I don't have any background tasks implemented, can this come from some 3rd party library such as Google Analytics or Fabric for example?

Yes, that’s very possible.

2. How do I "Break in UIApplicationEndBackgroundTaskError() to debug" to find out more about it? Where is it, how to do it? I don't see any docs for this UIApplicationEndBackgroundTaskError() function.

In Xcode, switch to the breakpoint navigator (View > Navigators > Show Breakpoint Navigator) then push the + button in the bottom left and select Add Symbolic Breakpoint and enter “UIApplicationEndBackgroundTaskError” as the symbol.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Replies

1. I don't have any background tasks implemented, can this come from some 3rd party library such as Google Analytics or Fabric for example?

Yes, that’s very possible.

2. How do I "Break in UIApplicationEndBackgroundTaskError() to debug" to find out more about it? Where is it, how to do it? I don't see any docs for this UIApplicationEndBackgroundTaskError() function.

In Xcode, switch to the breakpoint navigator (View > Navigators > Show Breakpoint Navigator) then push the + button in the bottom left and select Add Symbolic Breakpoint and enter “UIApplicationEndBackgroundTaskError” as the symbol.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

Hi eskimo:


After App breaks at UIApplicationEndBackgroundTaskError, then what info can I possibly get and how?

For my cast, Xcode did its job to stop, but seems no much info it can provide.


You need to look at the backtrace to see how you got to this call to

UIApplicationEndBackgroundTaskError
. Primarily you want to determine which subsystem within your app is making this mistake, that is, your code, or some subsystem within the OS itself.

Share and Enjoy

Quinn "The Eskimo!"
Apple Developer Relations, Developer Technical Support, Core OS/Hardware

let myEmail = "eskimo" + "1" + "@apple.com"

The system doesn't let the application go to suspended state if it is being debugged. I get the same error but almost close to the time (3 minutes) of getting killed. How can I set this symbolic breakpoint AND be able to step through it 😟

Thank you very much.
This helped me a lot!