I've been running into the exact same issue myself. It seems that simply referencing the constant NSUserActivityTypeLockedCameraCapture—even if it’s protected by an if #available check—causes a crash on devices running any iOS version below 18. Essentially, there's just no safe way to use that constant on iOS 18 and still maintain backward compatibility.
This is definitely one of those cases where an Apple engineer needs to step in and provide a fix or an official workaround.
Topic:
Media Technologies
SubTopic:
Photos & Camera