Android: error when using webcam in emulator

In a previous post , I received this error when starting the camera application in an emulator with a connected webcam:

CameraService::connect X (pid 702) rejected (invalid cameraId 0). 

After updating the dev tools, I got this other error (then, after creating a new emulator, I got the first error again):

 03-15 03:44:04.272: E/EmulatedCamera_QemuClient(40): queryStart: Query failed: Cannot start the camera 03-15 03:44:04.272: E/EmulatedCamera_QemuDevice(40): startDevice: Unable to start device 'AndroidEmulatorVC0' for NV21[640x480] frames 

[...]

 03-15 03:31:15.922: E/AndroidRuntime(785): FATAL EXCEPTION: Thread-76 03-15 03:31:15.922: E/AndroidRuntime(785): java.lang.RuntimeException: startPreview failed 03-15 03:31:15.922: E/AndroidRuntime(785): at com.android.camera.Camera.startPreview(Camera.java:1867) 03-15 03:31:15.922: E/AndroidRuntime(785): at com.android.camera.Camera.access$3100(Camera.java:87) 03-15 03:31:15.922: E/AndroidRuntime(785): at com.android.camera.Camera$5.run(Camera.java:1112) 03-15 03:31:15.922: E/AndroidRuntime(785): at java.lang.Thread.run(Thread.java:856) 03-15 03:31:15.922: E/AndroidRuntime(785): Caused by: java.lang.RuntimeException: startPreview failed 03-15 03:31:15.922: E/AndroidRuntime(785): at android.hardware.Camera.startPreview(Native Method) 03-15 03:31:15.922: E/AndroidRuntime(785): at com.android.camera.Camera.startPreview(Camera.java:1864) 03-15 03:31:15.922: E/AndroidRuntime(785): ... 3 more 

What causes this error? What is the best way to fix this problem?

+4
source share

Source: https://habr.com/ru/post/1469410/


All Articles