问题
This line of code is the problem I got today (macOS app):
NSArray *devices = [AVCaptureDevice devicesWithMediaType:AVMediaTypeVideo];
After I update Xcode, the system is alway got me empty devices array.
The thing is, the old projects(created before the update) work as expected.
What's going on here...?
Does anyone has the same problem?
------------UPDATE------------
I found this not just happened to my mac, also on the company's.
And it does affect my work.
回答1:
I think I found the answer...
Target Settings / Capabilities / App sandbox / Hardware
回答2:
This problem only happens on the Mac OS 10.13, Mac OS 10.12 is normal. I have the same problem, and there's no solution yet. AVCaptureDevice not found video device, i think it's apple that added permissions on the camera on 10.13.
来源:https://stackoverflow.com/questions/46426003/avcapturedevice-doesnt-find-any-device