iphone Crash log: preventSuspend preventIdleSleep
I have written an iPhone app that str开发者_JAVA技巧eams several radio stations. The app works fine and doesn't seem to crash and it even runs in the background fine. the only problem is that when I look at the crash logs on my iPhone, there is always multiple instances of the above crash log. This doesn't seem normal. Is there anything that I can do to get rid of this crash? Again, the user never sees a crash and the app actually continues to run beyond 600 second in the background just fine.
Exception Type: 00000020
Exception Codes: 0x8badf00d
Highlighted Thread: 0
Application Specific Information:
CBCJazz[1196] has active assertions beyond permitted time:
{(
<SBProcessAssertion: 0x63f8f90> identifier: UIKitBackgroundCompletionTask process: CBCJazz[1196] permittedBackgroundDuration: 600.000000 reason: finishTask owner pid:1196 preventSuspend preventIdleSleep
)}
Thanks for your help,
-RawMean
The most probably you don't end correctly your background tasks. The problem is each time the app goes in background the new task is created. And every task must be ended. See UIKitBackgroundCompletionTask - iPhone application crash
You have to add the key UIBackgroundModes
to your Info.plist
file. This key should indicate an array, and you should add one string element whose value is audio
.
Do not just start a background task and ignore the termination warning from the watchdog. If you already completed this step, then the crash logs may be there from before you did that.
For more information, see Declaring the Background Tasks You Support in the iOS Application Programming Guide.
精彩评论