Post

Replies

Boosts

Views

Activity

App Crashing at launching on iOS 15
We've been getting a crash on launch starting. We found that all crashing users triggered prewarm before. During the prewarm phase, we will create a thread, and after 15 seconds, the thread will perform the operation of clearing the pasteboard. I don't know if this is the cause of the problem. But the previous version of our app will not crash, and the previous version also has iOS 15 users Here is the crash log: long_text_2022-03-18-11-31-42.txt
2
0
1.6k
Mar ’22
Called endBackgroundTask but not working
When my app enter to background, I start a background task, and when Expiration happens, I end my background task. The code likes below: backgroundTask = [[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:^{ dispatch_async(dispatch_get_main_queue(), ^{ if (backgroundTask != UIBackgroundTaskInvalid) { [[UIApplication sharedApplication] endBackgroundTask:backgroundTask]; backgroundTask = UIBackgroundTaskInvalid; [self cancel]; } }); }]; When the breakpoint is triggered at the endBackgroundTask line, I also get the following log: [BackgroundTask] Background task still not ended after expiration handlers were called: <UIBackgroundTaskInfo: 0x282d7ab40>: taskID = 36, taskName = Called by MyApp, from MyMethod, creationTime = 892832 (elapsed = 26). This app will likely be terminated by the system. Call UIApplication.endBackgroundTask(:) to avoid this. The log don't appear every time, so why is that? Is there something wrong with my code?
3
0
2.8k
May ’23