Unknown CHHapticError.Code (1852797029 == 'nope') in iOS 18+ on iPhone 11 Pro

Hello,

I'm getting this error when launching a SpriteKit Swift game in iOS 18+ on an iPhone 11 Pro, whose shell is partly damaged in the back:

CHHapticEngine.mm:1206 -[CHHapticEngine doStartWithCompletionHandler:]_block_invoke: ERROR: Player start failed: The operation couldn’t be completed. (com.apple.CoreHaptics error 1852797029.)

Haptics do not work on this device, due to the damaged shell, so some error — which obviously occurs when calling start(completionHandler:) — is definitely expected; what is not expected is the main thread sometimes blocking for up to 5 seconds — although the method is not called from the main thread... the error itself is always displayed from some other secondary (system) thread. During this time, the main thread does not access the haptics engine at all; on average, it blocks once every four or five launches. In each launch (blocking or not), the 'nope' error is displayed ~5 seconds after trying to start the engine.

After going nuts with all kinds of breakpoints and instrumentation, I'm at a loss as to why the main thread would sometimes block...

Ideas, anyone?

Thank you, D.

I understand this is the textbook definition of "edge case", and something like this is very unlikely to be encountered in the wild — I'm just curious as to why sometimes the main thread blocks even though the related CHHaptcisEngine code does not run on the main thread...

Thanks, D.

Unknown CHHapticError.Code (1852797029 == 'nope') in iOS 18+ on iPhone 11 Pro
 
 
Q