[Android] “Cannot connect to camera” Fixes/Workarounds

Sunday, May 4, 2014 @ 5:00 pm

This seems to be a growing issue with Android phones, affecting users on versions 4.3 and 4.4 (Jellybean and KitKat). It’s particularly annoying because the camera is one of the key features for smartphones (e.g. selfies, food pictures, QR code scanning). Imagine an important event is unfolding before your eyes, you whip out your phone, open the Camera app only to get a “Can’t connect to the camera.” error. And a reboot is the only thing that will fix it. But by the time your phone finishes booting up, the event is over. This post goes through several workarounds/fixes.

I will list the fixes/workarounds in terms of difficulty, from least to most time consuming.

I have personally tried #1-8 in the below list at least twice in my quest to solve my issue, only discovering it was a specific app through a process of elimination. My particular issue was caused by #3.

1. Clearing the Camera/Gallery Data and Cache

A quick possible fix/workaround is clearing the data and cache for the Camera and Gallery apps:

  1. Settings
  2. Apps
  3. Scroll to “All”
  4. Find Camera and Gallery, and for each:
    1. Force stop
    2. Clear data (don’t worry, this won’t delete your photos)
    3. Clear cache

You can also try clearing your recent apps list (hold down menu, and tap on the “clear all” icon).

2. Removing/Replacing the MicroSD Card

If your phone has an expandable memory slot and you are storing photos on a MicroSD card, the card may have some corrupted sectors, leading to corrupted photos that the Gallery app automatically tries to load.

Try taking your MicroSD card out, reboot your phone, and see if this fixes your issue. If it does, you may need to insert a new MicroSD card.

3. Disabling/Uninstalling Apps that Use the Camera

This problem could be caused by apps that use the camera, and poorly “close” the camera when not in use.

Snapchat, Skype are widely reported apps that some users have had camera issues with. Other possible culprits may be QR code scanning apps, Google Goggles, and basically any app that has a camera feature.

In my case, my camera issues were being caused by Cerberus, an excellent anti-theft app with awesome features. The one feature that was causing my camera to die was the “Wrong Unlock Code Auto Photo Capture” setting. What this setting does is it takes a photo (using the front camera) when the number of failed unlock attempts is reached, and emails it to me along with the general location of the phone (GPS coordinates, a nearby wifi access point, and a rough street address). I have changed my failed attempts threshold from 1 (default), to 3. I chose not to completely disable this setting because I still want to get a nice picture and location of any potential future thief who decides it’s smart to steal my phone. I’ll just need to make sure to be more precise when entering my unlock code.

Side-note: I have integrated Cerberus into my actual ROM, meaning that it will even survive a wipe/factory reset.

How I was able to reproduce my particular issue was: rebooting my phone, correctly entering my unlock code, testing the camera to see if it was working, then locking my phone and entering multiple incorrect codes at once which would cause my camera to lock up and die.

4. Doing a Battery Pull

Shut down your phone, then open the back and take out the battery. Wait a few seconds, then put the battery back in and boot up your phone.

This step may not do anything, but it does allow your phone to rest and boot cleanly.

5. Killing the Mediaserver Process (root required)

A person named Temasek has created an app that runs the kill -9 `pidof mediaserver` command, which will restart the mediaserver process on your phone. It didn’t work for me, but it appears to have helped others.

It’s moreso a workaround than a fix. If your camera fails, just tap the Camera Restart app, wait 2 seconds, then try opening your camera again.

There is also the Atrix Camera Fix which most likely does the same thing.

Note: your phone must be rooted for the above two apps.

6. Updating your Camera Firmware

You will need to be on stock for this.

This requires you to copy the correct firmware for your phone model onto your phone, then dialing a specific number to open the system menu and flashing the firmware.

More information here (note: this is firmware for the S3)

7. Back-up all important photos/videos and delete them from your phone

Relating to points 1 and 2, the camera may be failing because there may be some corrupt photo/video files on your phone.

8. Doing a Factory Reset / Flashing back to Stock

Warning: this will delete all of your data. I consider this step a last resort.

Go to Settings => Backup and Reset => Factory Reset

Before doing so, you may wish to use Titanium Backup (root required) to backup your user apps, and another app to backup your SMS message/etc.

If you are on an AOSP-based ROM and are experiencing camera issues, you may want to flash back to stock, or use a stock-based rom (e.g. Dandroid for the S3).

In terms of flashing back to stock, I have an S3 and I have used firmwares posted in this thread on XDA-Developers.

NOTE: be sure to flash the correct ROM/firmware based on your phone model and firmware version. I am not responsible if you brick your phone.

9. Consider sending in your phone/doing a replacement

At this stage, if all 8 of the above steps don’t work, the last step would be to either get someone to look at your phone and do a possible hardware camera swap, or replace your phone.

My Phone

If you’re curious to what my current set-up is:

  • Samsung Galaxy S3 (stock battery)
  • SlimBean 4.3.1 build 2.2 (mainly because I’m waiting for SlimKat to become more stable)
  • LeanKernel 8.6 experimental 1 (used Trickster Mod to customize my settings: interactiveX/row (go_hispeed_load 95, screen_off_maxfreq 486000), 192-1512, frequency locked, read ahead 512, MP-Decision off, multicore power saving 1, GPU max 400, undervolted (775 to 1125 max), with everything else at default LeanKernel settings)
  • 32 GB MicroSD card
  • Otterbox Defender