我正在尝试创建一个Android虚拟机来测试一些相机应用程序。当我使用下面显示的配置选项启动AVD时,我通常会收到“不幸的是,相机已停止。”#39;错误。有时,相机应用程序实际上工作。这是模拟器中的默认相机应用程序。
我的AVD规格:
如果图片不可用,这是AVD规范的文本:
Device: 5.4" FWVGA (480 X 854: mdpi)
Target: Android 5.0.1 - API Level 21
CPU/ABI: ARM(armeabi-v7a)
Keyboard: (checked) Hardware keyboard present
Skin: No skin
Front Camera: None
Back Camera: Webcam0
Memory Options: RAM:512 VM Heap:16
Internal Storage: 200 MiB
SD Card: Size 200 MiB
File: [blank]
Emulation Options: (unchecked) Snapshot (checked) Use Host GPU
以下是相机无法启动时收到的错误图片:
如果你看不到屏幕捕获的图片错误窗口说,"不幸的是,相机已停止"。
当应用程序不起作用时,我会看到以下框:
当相机应用程序实际运行时,模拟器启动时网络摄像头灯也会亮起,并且不会要求我选择哪个网络摄像头。
当相机不工作时,会显示日志中这些有趣的行:
01-23 10:32:08.324: V/CameraHolder(1033): open camera 0
01-23 10:32:08.334: E/CameraService(65): CameraService::connect X (pid 1033) rejected (invalid cameraId 0).
01-23 10:32:08.339: W/CameraBase(1033): An error occurred while connecting to camera: 0
01-23 10:32:08.409: E/CameraHolder(1033): fail to connect Camera
01-23 10:32:08.409: E/CameraHolder(1033): java.lang.RuntimeException: Fail to connect to camera service
01-23 10:32:08.409: E/CameraHolder(1033): at android.hardware.Camera.<init>(Camera.java:497)
01-23 10:32:08.409: E/CameraHolder(1033): at android.hardware.Camera.open(Camera.java:342)
01-23 10:32:08.409: E/CameraHolder(1033): at com.android.camera.CameraHolder.open(CameraHolder.java:131)
01-23 10:32:08.409: E/CameraHolder(1033): at com.android.camera.Util.openCamera(Util.java:267)
01-23 10:32:08.409: E/CameraHolder(1033): at com.android.camera.Camera$4.run(Camera.java:1100)
01-23 10:32:08.409: E/CameraHolder(1033): at java.lang.Thread.run(Thread.java:818)
01-23 10:32:08.409: E/CameraHolder(1033): --------- beginning of crash
01-23 10:32:08.425: E/AndroidRuntime(1033): FATAL EXCEPTION: Thread-112
01-23 10:32:08.425: E/AndroidRuntime(1033): Process: com.android.camera, PID: 1033
01-23 10:32:08.425: E/AndroidRuntime(1033): java.lang.RuntimeException: openCamera failed
01-23 10:32:08.425: E/AndroidRuntime(1033): at com.android.camera.Util.openCamera(Util.java:272)
01-23 10:32:08.425: E/AndroidRuntime(1033): at com.android.camera.Camera$4.run(Camera.java:1100)
01-23 10:32:08.425: E/AndroidRuntime(1033): at java.lang.Thread.run(Thread.java:818)
01-23 10:32:08.425: E/AndroidRuntime(1033): Caused by: com.android.camera.CameraHardwareException: java.lang.RuntimeException: Fail to connect to camera service
01-23 10:32:08.425: E/AndroidRuntime(1033): at com.android.camera.CameraHolder.open(CameraHolder.java:135)
01-23 10:32:08.425: E/AndroidRuntime(1033): at com.android.camera.Util.openCamera(Util.java:267)
01-23 10:32:08.425: E/AndroidRuntime(1033): ... 2 more
01-23 10:32:08.425: E/AndroidRuntime(1033): Caused by: java.lang.RuntimeException: Fail to connect to camera service
01-23 10:32:08.425: E/AndroidRuntime(1033): at android.hardware.Camera.<init>(Camera.java:497)
01-23 10:32:08.425: E/AndroidRuntime(1033): at android.hardware.Camera.open(Camera.java:342)
01-23 10:32:08.425: E/AndroidRuntime(1033): at com.android.camera.CameraHolder.open(CameraHolder.java:131)
01-23 10:32:08.425: E/AndroidRuntime(1033): ... 3 more
01-23 10:32:08.448: W/ActivityManager(350): Force finishing activity com.android.camera/.Camera
01-23 10:32:08.775: I/WindowManager(350): Screenshot max retries 4 of Token{3946fe74 ActivityRecord{3ae28647 u0 com.android.camera/.Camera t25 f}} appWin=Window{7b73fe3 u0 Starting com.android.camera} drawState=4
有谁知道发生了什么事?我在Windows 7操作系统上。