iOS App on Mac fails to detect camera not present

When running an iOS app as designed for iPad on an m1 Mac mini the UIImagePickerController.isSourceTypeAvailable(.camera) api returns true leading to a crash (attached) if the camera is selected to upload an image to the app as my much loved Mac mini does not have a camera.

For the moment have disabled camera if platform is Mac by adding the qualification: ProcessInfo().isiOSAppOnMac == false but this seems like a bug or does the crash also happen on Macs with cameras?

Other image picker options work fine.

I’m glad you were able to work around this.

but this seems like a bug

Agreed. I recommend that you file it as such. Please post your bug number, just for the record.

Share and Enjoy

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

Thanks! Filed as FB13688595.

I was seeing a similar crash. I was able to resolve it by following this SO post: https://stackoverflow.com/questions/68028712/validatetextureview557-failed-assertion-texture-view-validation-cannot-creat

I had to turn off Metal API Validation for my Debug and Release scheme. Hope this helps.

iOS App on Mac fails to detect camera not present
 
 
Q