watchOS app crashing on Series 10 - cannot reproduce on Series 8 running same watchOS version

I'm receiving reports from users that my app is crashing immediately after being opened on the Apple Watch Series 10 using watchOS 11.

I've updated my personal Apple Watch Series 8 to watchOS 11 and I'm unable to reproduce this crash using the same release build from the App Store. The version currently on the App Store was built using Xcode 15.4 (22622).

I'm preparing an update that is built using Xcode 16.0 (23051) and have asked one of the users reporting the crash to try a TestFlight build built using Xcode 16.0 and they are no longer experiencing this crash.

As far as I can tell, the only difference between the version on the App Store and the TestFlight build is that it is built with the watchOS 11 SDK included with Xcode 16.0. I don't think any of my app's dependencies (all managed by Swift Package Manager) have been updated in the TestFlight build.

I'm attaching a crash report submitted by one of the users. I believe this is a partially symbolicated crash report and have tried opening it in Xcode in an attempt to make it fully symbolicated without success. I've also received a video recording of the app crashing.

I'm also not able to see any crashes occurring with an Apple Watch Series 10 in the Xcode Organizer, which leads me to believe this crash may be occurring at the Springboard level.

Any help to further diagnose this issue would be much appreciated.

Answered by DTS Engineer in 807885022

Coming back to the actual crashing issue…

Yesterday we started seeding watchOS 11.1 beta 4 (22R5569a). Based on my view of your bug, I believe that the issue is fixed there. If not, please let us know.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I'm unable to include the crash report as an attachment due to a warning about the post containing sensitive language.

Does anyone know of an email address to contact developer relations?

I've submitted reports through the Feedback Assistant app in the past but don't often receive replies there.

Dropbox link for the crash report: https://www.dropbox.com/scl/fi/9q88masijfcngig24jmvm/WatchCloud-Watch-App-2024-09-25-163744-Watch-Series-10-Xcode-15.4-22622.crash?rlkey=founp959ssx1jzffou3w20g8n&st=ge44ej82&dl=0

I'm unable to include the crash report as an attachment due to a warning about the post containing sensitive language.

Yeah, that’s annoying; I’d appreciate you filing a bug against the forums about this. Please post your bug number, just for the record.

In many cases you can avoid the issue by putting the crash report into a reply rather than your original post.

If that doesn’t work, you can post a link to it. Which is what you did below. Which is great!

Looking at the crash report, I see this:

Last Exception Backtrace:
0   CoreFoundation  … __exceptionPreprocess + 160
1   libobjc.A.dylib … objc_exception_throw + 71
2   Foundation      … -[NSAssertionHandler handleFailureInFunction:file:lineNumber:description:] + 263
3   UIKitCore       … _UIGraphicsBeginImageContextWithOptions + 543
4   PepperUICore    … -[PUICActivityIndicatorView _updateContentImage] + 259
5   PepperUICore    … -[PUICActivityIndicatorView setColor:] + 75
6   SwiftUI         … 0x47ca54f5 + 935
…

Frame 3 should be familiar if you’ve done any UIKit work; it’s an internal component of UIGraphicsBeginImageContextWithOptions. That’s throwing a language exception, which isn’t good. If I’m reading things right, the message should be something like UIGraphicsBeginImageContext() failed to allocate CGBitampContext [sic].

Looking at the caller, frame 4, that’s obviously some sort of activity indicator. It’s a classic UIView-style view, and frame 7 is bridging to it from SwiftUI via the UIViewRepresentable. And beyond that it’s oodles and oodles of SwiftUI.

So:

  1. SwiftUI is running an update…

  2. Which is coming through to an activity indicator view…

  3. Which is trying to draw something…

  4. Which is triggering this exception…

  5. Because it can’t create a graphics context.

And that’s pretty much where I leave you, alas. We are deep in UI and graphics stuff, which is far from my area of expertise.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Hi @SuperTurboRyan,

I'm sorry your customers are seeing this issue. Did you manage to file a feedback report for the issue and include the crash log? If so, will you post the Feedback number as a reply here? That will help us make sure you get notified when a fix for this is released.

Thank you for reporting this and being so specific about the details about the builds and models where this is occurring.

Hi @DTS Engineer , I've received a response to FB15292000 saying they will close the feedback report as resolved since I was able to upload the crash report to Dropbox and include a link in a reply.

I don't think it makes sense to resolve this feedback report in this way. The feedback report is about not being able to add a crash report as an attachment to a post on the forums.

Update:

I'm able to attach the crash report to this reply, I don't know if this would also work for the original post. Perhaps the response I've received to the feedback report wasn't clear enough!

Regarding the difficulty posting a crash report:

Perhaps the response I've received to the feedback report wasn't clear enough!

No, it’s that the mechanism used to identify “sensitive language” isn’t always consistent. You’re experience is not uncommon. I happen to be discussing it with the forums platform folks right now, so I’ll use this as a great example of this issue.


Regarding the crashing issue, it seems like someone else is helping out with that.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

I also received a similar report from a user that the app crashes only on Apple Watch 10 devices that have updated their OS to version 11.

It absolutely does not occur on other devices (Watch 7/8/SE2) that have updated their OS to 11.

If you have improved the "_UIGraphicsBeginImageContextWithOptions" part, could you please help me with how you modified it?

We haven't purchased the Apple Watch 10 device yet.

Coming back to the actual crashing issue…

Yesterday we started seeding watchOS 11.1 beta 4 (22R5569a). Based on my view of your bug, I believe that the issue is fixed there. If not, please let us know.

Share and Enjoy

Quinn “The Eskimo!” @ Developer Technical Support @ Apple
let myEmail = "eskimo" + "1" + "@" + "apple.com"

Accepted Answer

Crash "fixed" by building app using Xcode 16

Hey, I got the same issue.

This issue only affects users with the Apple Watch Series 10. The crash happens whenever ProgressView() appears in the UI. It occurs specifically at _UIGraphicsBeginImageContextWithOptions.

To fix this issue, upgrade your build mac to Xcode 16 if possible. If you can't, you can use the following workaround.

if #available(watchOS 11.0, *) {
    EmptyView()
} else {
    ProgressView()
        .tint(Color.accentColor)
}
watchOS app crashing on Series 10 - cannot reproduce on Series 8 running same watchOS version
 
 
Q