I cannot use camera in genymotion emulator

37,506

Solution 1

UPDATE Made it a community wiki in case someone else has something to add, I can't keep this updated right now :)

It could just be that you didn't activate the camera for the emulator. Opposed to the stock emulators that once you set up the webcam they just work, on genymotion emulators you need to turn the cameras on. The process is very simple.

On the emulator window, press ctrl+3 or +3 to bring the camera configuration panel that looks like the left, and turn it on like on the right: enter image description here

You can select a dummy camera which will show a genymotion logo moving around the screen or use the system camera if it's available and preview it. Note that on the above screenshot I'm using the phone front camera instead of the back camera.

Solution 2

If all the other solutions do not seem to work you can keep the virtual device working and restart eclipse, and the adb process and it should work. It worked for me. My guess is that the connection to adb is already taken by some other camera and that's blocking your current camera from connecting to the IDE development with the virtual device.

Solution 3

If you are using Intellij Idea no need to restart Genymotion or IDE.

  1. Genymotion: Switch off camera
  2. Intellij IDEA: From menu select Tools/Android/"Enable ADB Integration"
  3. Genymotion: Switch on camera

It should works for you as well.

Solution 4

Just expanding the @sivi's answer:

In my case, i just re-established the connection to emulator using these :

adb kill-server ---> adb start-server

and it started working perfectly.

Solution 5

If you are using eclipse, I found out going to DDMS and then Devices you can reset the adb. You can find the option by clicking on the drop down arrow that says "View Menu".

Example to find Rest adb.

Share:
37,506
Mohammed Subhi Sheikh Quroush
Author by

Mohammed Subhi Sheikh Quroush

I am Informatics Engineering graduate from Aleppo University, and now I am studying Master in ITÜ university.

Updated on March 25, 2020

Comments

  • Mohammed Subhi Sheikh Quroush
    Mohammed Subhi Sheikh Quroush about 4 years

    I am using genymotion emulator http://www.genymotion.com/ but when I opened the camera , I got message "cannot connect to the camera " , what is the problem ?

  • albertpeiro
    albertpeiro about 10 years
    Got the same problem running MacOSX 10.7 Geny 4.1.1. App with a camera preview doesn't quite work. What's weird is it does sometimes when I switch randomly Dummy to webcam. Suddenly preview works and when switching settings or rebooting app is back to black screen.
  • Yannick De Turck
    Yannick De Turck about 10 years
    If you keep getting the "Can't connect to the camera"-alert, even though the camera has been set to 'On' in Genymotion, you could try recreating the virtual device. That fixed it for me.
  • Hesam
    Hesam about 10 years
    Even on Windows I cannot see anything on Emulator although I can see my image on preview side. My camera is on, exactly like above part.
  • Coisox
    Coisox about 10 years
    Thx man! You save my time from trying ANOTHER "best" emulator... When I got this problem, turn off Eclipse > restart Genymotion > On camera widget > start Eclipse.
  • sivi
    sivi almost 10 years
    actually shutting adb (it automatically restarts) is enough you don't have to restart eclipse.
  • dharmendra
    dharmendra almost 10 years
    Oh man , i can't believe how you got this idea ;) it works for me
  • Jack
    Jack over 9 years
    I allready had it selected, although I just un selected then re selected and it worked! Using Android studio 1.0.2. Thanks!
  • John Shipp
    John Shipp about 8 years
    On OSX, I did the following to make it work: 1. Destroy the virtual device 2. From the CLI, adb kill-server 3. Create a new virtual device 4. ionic run android