Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camera of any emulator not working

Friends

I am facing this issue since so long but i am able to get any kind of solution to get working camera in emulator. I have gone through all the answer of the SO but none helped me uptill now.

If i create any emulator with any api but in none of my emulator camera application does not work. So i am not able to test any of the application which contains camera functionality. I guess may be its happening because of the hardware configuration of my system. But i am not sure about it.

I do not know why this issue occurs. Please help me to solve and find out the reason for the issue.

Here is the error which i get whenever i starts camera in emulator.

12-21 00:04:58.100: E/CameraService(55): CameraService::connect X (pid 2604) rejected (invalid cameraId 0).
12-21 00:04:58.110: W/CameraBase(2604): An error occurred while connecting to camera: 0
12-21 00:04:58.110: E/CameraHolder(2604): fail to connect Camera
12-21 00:04:58.110: E/CameraHolder(2604): java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.native_setup(Native Method)
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.<init>(Camera.java:350)
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.open(Camera.java:309)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.CameraHolder.open(CameraHolder.java:131)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.Util.openCamera(Util.java:267)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.Camera$4.run(Camera.java:1100)
12-21 00:04:58.110: E/CameraHolder(2604):   at java.lang.Thread.run(Thread.java:841)
12-21 00:04:58.110: W/dalvikvm(2604): threadid=11: thread exiting with uncaught exception (group=0xb4a29b90)
12-21 00:04:58.120: E/AndroidRuntime(2604): FATAL EXCEPTION: Thread-117
12-21 00:04:58.120: E/AndroidRuntime(2604): Process: com.android.camera, PID: 2604
12-21 00:04:58.120: E/AndroidRuntime(2604): java.lang.RuntimeException: openCamera failed
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Util.openCamera(Util.java:272)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Camera$4.run(Camera.java:1100)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at java.lang.Thread.run(Thread.java:841)
12-21 00:04:58.120: E/AndroidRuntime(2604): Caused by: com.android.camera.CameraHardwareException: java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.CameraHolder.open(CameraHolder.java:135)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Util.openCamera(Util.java:267)
12-21 00:04:58.120: E/AndroidRuntime(2604):     ... 2 more
12-21 00:04:58.120: E/AndroidRuntime(2604): Caused by: java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.native_setup(Native Method)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.<init>(Camera.java:350)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.open(Camera.java:309)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.CameraHolder.open(CameraHolder.java:131)
12-21 00:04:58.120: E/AndroidRuntime(2604):     ... 3 more

Below are the options which i get while i am trying to edit emulator.

enter image description here Thanks.

like image 419
GrIsHu Avatar asked Dec 21 '13 05:12

GrIsHu


1 Answers

I have resolved my issue by changing the emulators "Back Camera" property to Emulated as shown in screenshot.

enter image description here

like image 88
GrIsHu Avatar answered Oct 18 '22 22:10

GrIsHu