dyld[434]: Library not loaded: error when running LockedCameraCapture compatible app on iOS 15

Hello,

I am getting the following error while attempting to run my LockedCameraCapture compatible app on an iOS 15 device:

dyld[434]: Library not loaded: '/System/Library/Frameworks/LockedCameraCapture.framework/LockedCameraCapture'
  Referenced from: '/private/var/containers/Bundle/Application/.../MyApp.app/MyApp.debug.dylib'
  Reason: tried: '/System/Library/Frameworks/LockedCameraCapture.framework/LockedCameraCapture' (no such file)

Of course iOS 15 doesn't have the library for LockedCameraCapture, but I have had no issue including Lock Screen Widgets (which require iOS 16), so I am not sure why the error is popping up.

Thank you!

Answered by edee1337 in 807279022

Figured it out: my Capture Extension View (UIViewControllerRepresentable) file had a target membership linked to the main app. Added by accident, removing it was the fix 😅

Accepted Answer

Figured it out: my Capture Extension View (UIViewControllerRepresentable) file had a target membership linked to the main app. Added by accident, removing it was the fix 😅

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.

dyld[434]: Library not loaded: error when running LockedCameraCapture compatible app on iOS 15
 
 
Q