HKElectrocardiogramQuery is only available on iOS14.0 (https://developer.apple.com/documentation/healthkit/hkelectrocardiogramquery?language=objc)
So its usage on an iOS 12.0 device will cause crashes.
If you want to support iOS 12.0 devices, you'd have to set the minimum iOS version in the build settings under iOS Deployment Target. And if your app uses API that were introduced in iOS versions > 12.0 then you need to add availability checks in your code.
Topic:
Developer Tools & Services
SubTopic:
Xcode
Tags: