7

I have a app that opens straight to a camera that is based on this WWDC sample: https://developer.apple.com/library/ios/samplecode/AVCam/Introduction/Intro.html

A few users have been experiencing a bug where the camera does not turn on and does not allow them to capture content.

I just ran into the same issue last night and this is what I observed:

  1. I was debugging a separate issue and the camera was working 100% ok, then all of a sudden, it stopped working.

  2. Every time I would open the app or navigate back to the camera, it would show a dark view of whatever it was currently pointing at, but the image was frozen. Its like it worked for 1 second, then the capture preview would freeze.

  3. I tried force closing and reopening, same problem.

  4. I tried uninstalling and reinstalling, same problem.

  5. I then restarted my phone and the issue was solved.

How is it possible that this bug persists between separate installs?

Does anyone know what might be causing the camera to fail?

How should I go about debugging it if it only occurred once after months of using it and I have no idea what triggers it?

Cbas
  • 6,003
  • 11
  • 56
  • 87

2 Answers2

3

Are you running iOS 9? That might be an iOS 9 software internal bug. I had exactly the same non-reproducible issues but with MapKit's map view rendering. In my case map view was showing just rectangle grid without any map objects - no streets, lakes, rivers, etc.

I've tried to google over internet to find potential reason of such weird issue, but without any luck. Then I've restarted device and that helped, the same as in your case.

Sure, my info is not a full answer, just want to share my experience.

Evgeny Karkan
  • 8,782
  • 2
  • 32
  • 38
  • I observed it on iOS9 but another user has seen it about 4 times on iOS10 – Cbas Aug 23 '16 at 22:53
  • @Cbas - well, I've tried to search opened `rdars` with `camera` as query and the results are here - http://www.openradar.me/search?query=camera. I would suggest you to look closely at them - maybe you will find `rdar` related to your situation. – Evgeny Karkan Aug 28 '16 at 13:24
  • Thanks for the link, I read through them but didn't find any related – Cbas Aug 29 '16 at 02:34
2

Your process does not have direct access to the camera hardware, but rather through a device manager. It is the state of that manager that determines if things will work.

To confirm, when your app is experiencing issues, kill it then open the default Camera app. If it shows a blank or still frame preview, then you know it's not necessarily a problem in your app.

szym
  • 5,606
  • 28
  • 34
  • I checked last time this happened and the default camera worked and Snapchat was also working. The camera problem was only effecting my app – Cbas Aug 24 '16 at 20:51