Android虚拟设备管理器 - 4.4.2上的Webcam0无法正常工作

时间:2015-10-28 09:46:38

标签: android android-emulator

我已经在AVD(下面的完整设置)中配置了一个虚拟的4.4.2(手臂)Android设备,并且需要使用我的网络摄像头来测试相机。

相机应用程序启动并立即崩溃(相机已停止工作)。

我得到以下日志输出:

10-28 05:43:41.220      370-548/system_process I/ActivityManager﹕ Start proc com.android.camera for activity com.android.camera/.Camera: pid=1136 uid=10030 gids={50030, 1028, 1015}
10-28 05:43:42.100    1136-1150/com.android.camera V/CameraHolder﹕ open camera 0
10-28 05:43:42.100       60-125/? E/CameraService﹕ CameraService::connect X (pid 1136) rejected (invalid cameraId 0).
10-28 05:43:42.110    1136-1150/com.android.camera W/CameraBase﹕ An error occurred while connecting to camera: 0
10-28 05:43:42.110    1136-1150/com.android.camera E/CameraHolder﹕ fail to connect Camera
    java.lang.RuntimeException: Fail to connect to camera service
            at android.hardware.Camera.native_setup(Native Method)
            at android.hardware.Camera.<init>(Camera.java:351)
            at android.hardware.Camera.open(Camera.java:310)
            at com.android.camera.CameraHolder.open(CameraHolder.java:131)
            at com.android.camera.Util.openCamera(Util.java:267)
            at com.android.camera.Camera$4.run(Camera.java:1100)
            at java.lang.Thread.run(Thread.java:841)
10-28 05:43:42.120    1136-1150/com.android.camera W/dalvikvm﹕ threadid=11: thread exiting with uncaught exception (group=0xb1ab5ba8)
10-28 05:43:42.120    1136-1150/com.android.camera E/AndroidRuntime﹕ FATAL EXCEPTION: Thread-87
    Process: com.android.camera, PID: 1136
    java.lang.RuntimeException: openCamera failed
            at com.android.camera.Util.openCamera(Util.java:272)
            at com.android.camera.Camera$4.run(Camera.java:1100)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: com.android.camera.CameraHardwareException: java.lang.RuntimeException: Fail to connect to camera service
            at com.android.camera.CameraHolder.open(CameraHolder.java:135)
            at com.android.camera.Util.openCamera(Util.java:267)
            at com.android.camera.Camera$4.run(Camera.java:1100)
            at java.lang.Thread.run(Thread.java:841)
     Caused by: java.lang.RuntimeException: Fail to connect to camera service
            at android.hardware.Camera.native_setup(Native Method)
            at android.hardware.Camera.<init>(Camera.java:351)
            at android.hardware.Camera.open(Camera.java:310)
            at com.android.camera.CameraHolder.open(CameraHolder.java:131)
            at com.android.camera.Util.openCamera(Util.java:267)
            at com.android.camera.Camera$4.run(Camera.java:1100)
            at java.lang.Thread.run(Thread.java:841)

AVD-设置:

Name: Samsung_Galaxy_S3_API_19

CPU/ABI: ARM (armeabi-v7a)

Path: D:\Users\rowi1de\.android\avd\Samsung_Galaxy_S3_API_19.avd

Target: Android 4.4.2 (API level 19)

Skin: galaxy_s3_blue

SD Card: D:\Users\rowi1de\.android\avd\Samsung_Galaxy_S3_API_19.avd\sdcard.img

Snapshot: no

hw.dPad: no

runtime.network.speed: full

hw.accelerometer: yes

hw.device.name: Samsung Galaxy S3

vm.heapSize: 64

skin.dynamic: no

hw.device.manufacturer: User

hw.gps: yes

hw.audioInput: yes

hw.cpu.model: cortex-a8

tag.id: default

hw.camera.back: webcam0

hw.mainKeys: yes

AvdId: Samsung_Galaxy_S3_API_19

hw.camera.front: none

hw.lcd.density: 320

runtime.scalefactor: auto

hw.gsmModem: yes

avd.ini.displayname: Samsung Galaxy S3 API 19

snapshot.present: no

hw.device.hash2: MD5:e6de262aae26d1ce2c8a8b656265afbc

hw.ramSize: 1536

hw.trackBall: no

hw.battery: yes

hw.camera: yes

hw.sdCard: yes

tag.display: Default

runtime.network.latency: none

hw.keyboard: yes

hw.touchScreen: yes

hw.sensors.proximity: yes

disk.dataPartition.size: 200M

hw.sensors.orientation: yes

avd.ini.encoding: UTF-8

hw.gpu.enabled: yes

知道如何解决这个问题吗?

此致 罗伯特

1 个答案:

答案 0 :(得分:2)

使用Genymotion测试app,它像AVD一样工作,你可以在Genymotion中使用Camera。

您可以查看链接关于Genymotion和Genymotion的功能。 Click here