android – 任何模拟器的相机无法正常工作

前端之家收集整理的这篇文章主要介绍了android – 任何模拟器的相机无法正常工作前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

我这么长时间面对这个问题但是我能够得到任何解决方案来在模拟器中使用相机.我已经完成了SO的所有答案,但现在没有人帮助我.

如果我用任何api创建任何模拟器,但我的模拟器相机应用程序都不起作用.所以我无法测试任何包含相机功能的应用程序.我想可能是它的发生,因为我的系统的硬件配置.但我不确定.

我不知道为什么会出现这个问题.请帮我解决并找出问题的原因.

这是我在模拟器中启动相机时得到的错误.

12-21 00:04:58.100: E/CameraService(55): CameraService::connect X (pid 2604) rejected (invalid cameraId 0).
12-21 00:04:58.110: W/CameraBase(2604): An error occurred while connecting to camera: 0
12-21 00:04:58.110: E/CameraHolder(2604): fail to connect Camera
12-21 00:04:58.110: E/CameraHolder(2604): java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.native_setup(Native Method)
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.<init>(Camera.java:350)
12-21 00:04:58.110: E/CameraHolder(2604):   at android.hardware.Camera.open(Camera.java:309)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.CameraHolder.open(CameraHolder.java:131)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.Util.openCamera(Util.java:267)
12-21 00:04:58.110: E/CameraHolder(2604):   at com.android.camera.Camera$4.run(Camera.java:1100)
12-21 00:04:58.110: E/CameraHolder(2604):   at java.lang.Thread.run(Thread.java:841)
12-21 00:04:58.110: W/dalvikvm(2604): threadid=11: thread exiting with uncaught exception (group=0xb4a29b90)
12-21 00:04:58.120: E/AndroidRuntime(2604): FATAL EXCEPTION: Thread-117
12-21 00:04:58.120: E/AndroidRuntime(2604): Process: com.android.camera,PID: 2604
12-21 00:04:58.120: E/AndroidRuntime(2604): java.lang.RuntimeException: openCamera Failed
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Util.openCamera(Util.java:272)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Camera$4.run(Camera.java:1100)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at java.lang.Thread.run(Thread.java:841)
12-21 00:04:58.120: E/AndroidRuntime(2604): Caused by: com.android.camera.CameraHardwareException: java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.CameraHolder.open(CameraHolder.java:135)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.Util.openCamera(Util.java:267)
12-21 00:04:58.120: E/AndroidRuntime(2604):     ... 2 more
12-21 00:04:58.120: E/AndroidRuntime(2604): Caused by: java.lang.RuntimeException: Fail to connect to camera service
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.native_setup(Native Method)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.<init>(Camera.java:350)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at android.hardware.Camera.open(Camera.java:309)
12-21 00:04:58.120: E/AndroidRuntime(2604):     at com.android.camera.CameraHolder.open(CameraHolder.java:131)
12-21 00:04:58.120: E/AndroidRuntime(2604):     ... 3 more

以下是我在尝试编辑模拟器时获得的选项.

谢谢.

解决方法

我通过将模拟器“Back Camera”属性更改为Emulated来解决我的问题,如屏幕截图所示.

猜你在找的Android相关文章