AVCaptureSession error persists between installations

I have an application that opens directly to a camera based on this WWDC example: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html

Several users experience an error when the camera does not turn on and does not allow capturing content.

I just came across the same question last night, and this is what I observed:

  • I debugged a separate problem, and the camera worked 100% fine, then suddenly stopped working.

  • Each time I open the application or return to the camera, it will show a dark view of what it currently indicates, but the image was frozen. As if it worked for 1 second, then the capture preview was frozen.

  • I tried force closing and reopening, same problem.

  • I tried uninstalling and reinstalling the same problem.

  • Then I restarted my phone and the problem was resolved.

How is it possible that this error persists between separate installations?

Does anyone know what could cause the camera to crash?

How should I debug it if it appears only once after several months of using it and I don’t know what launches it?

+7
ios avfoundation camera avcapturesession avcapturedevice
source share
2 answers

Are you using iOS 9 ? This may be an internal iOS 9 software bug. I had exactly the same irreproducible issues, but with MapKit rendering rendering. In my case, only a rectangular section was shown on the map without any map objects β€” there are no streets, lakes, rivers, etc.

I tried to use Google over the Internet to find a potential cause for such a strange problem, but with no luck. Then I restarted the device and it helped, just like in your case.

Of course, my information is not a complete answer, I just want to share my experience.

+3
source share

Your process does not have direct access to the camera apparatus, but rather through the device manager. The state of this manager determines whether things will work.

To confirm when your application is having problems, kill it, then open the default camera application. If it shows a preview of an empty or fixed frame, then you know that this is not necessarily a problem in your application.

+2
source share

All Articles