问题
I have an Android 4.1.2 AVD that needs to use the camera. I tried using my webcam as a substitute in the emulator, but I get this error:
[2012-11-16 10:35:37 - Emulator] emulator: ERROR: _camera_client_query_start: Cannot start camera 'AndroidEmulatorVC0' for NV21[640x480]: Result too large
How do I fix this error?
回答1:
Goto window -> AVD Manager -> select your AVD name ->click Edit button -> Abstracted LCD density click value drop down value select 160.
To enable Camera in your Android Emulator, just add following highlighted code in your AVD’s config.ini file. You can find the config.ini file under your user directory/.android folder.
File: ~/.android/config.ini
hw.lcd.density=160
skin.name=HVGA
skin.path=platforms\android-9\skins\HVGA
hw.cpu.arch=arm
abi.type=armeabi
vm.heapSize=24
image.sysdir.1=platforms\android-9\images\
hw.camera=yes
sdcard.size=64M
...
回答2:
To fix this problem. Just go to AVD Manager, EDIT your device. At the SD Card section, increase the size from blank to a certain amount. I put mine 64MiB and it worked fine.
回答3:
There is this option "EMULATED" (along with NO CAMERA and WEBCAM0) in the AVD manager advanced settings, it did the trick for me.
回答4:
Maybe the resulting image or video is in fact, too large to be true for a smartphone or a tablet? In any case, if you need to test hardware-dependent features such as the camera, it's wise to directly do it on a device. You can't assume that the camera in your computer or webcam behaves the same as the camera in a smartphone.
来源:https://stackoverflow.com/questions/13413943/webcam-in-android-emulator-cannot-start-camera-and-result-too-large