Android Emulator cannot connect to webcam with “un

2019-03-20 19:02发布

问题:

After upgrading my macbook to Yosemite, I have been getting the following error whenever I launch an android emulator. I've tried all combinations of settings, but all report the same error. Any attempt to launch the built in camera app, or use the camera in my own app produces a crash. Below is the error I get when the emulator launches. Running the emulator with additional debug flags did not produce any additional useful info.

emulator: ERROR: Unrecognized pixel format 'v024'
emulator: ERROR: Pixel format 'v024' reported by the camera device is unsupported

This is an example of one of my emulator configurations:

Name: Nexus_5_API_21
CPU/ABI: Google APIs Intel Atom (x86_64)
Path: /Users/rob/.android/avd/Nexus_5_API_21.avd
Target: Google APIs (API level 21)
Skin: nexus_5
SD Card: 100M
Snapshot: no
hw.lcd.density: 480
hw.dPad: no
avd.ini.encoding: UTF-8
hw.camera.back: webcam0
disk.dataPartition.size: 200M
hw.gpu.enabled: yes
runtime.network.latency: none
skin.dynamic: no
hw.keyboard: yes
runtime.network.speed: full
hw.device.hash2: MD5:2fa0e16c8cceb7d385183284107c0c88
hw.ramSize: 1536
tag.id: google_apis
tag.display: Google APIs
hw.sdCard: yes
hw.device.manufacturer: Google
hw.mainKeys: no
hw.accelerometer: yes
hw.trackBall: no
hw.device.name: Nexus 5
hw.sensors.proximity: yes
hw.battery: yes
AvdId: Nexus_5_API_21
hw.sensors.orientation: yes
hw.audioInput: yes
hw.camera.front: none
hw.gps: yes
avd.ini.displayname: Nexus 5 API 21
snapshot.present: no
vm.heapSize: 64
runtime.scalefactor: auto

The webcam works fine for other applications like photobooth or facetime.

Any ideas for how I might be able to resolve this error are greatly appreciated.

回答1:

I had the same error. I fixed it by opening the Photo Booth app and then restarted the AVD while having Photo Booth in the background.