我在Windows 7笔记本上用CPU:ARM(armeabi-v7a)创建了一个AVD,并将前后摄像头选项设置为“Webcam0”.
当我启动模拟器并单击相机按钮时,它显示“不幸的是相机停止了”
我跟踪了关于此问题的所有答案,但没有一个对我有用.
1)我检查了我的网络摄像头驱动程序,它很好,因为我的网络摄像头驱动程序的最新版本已于2012年5月发布,它们是最新的
2)我检查了前置摄像头和后置摄像头的所有选项(仿真器/ Webcam0).
3)我从相机中清除了所有缓存数据并重新启动.
`05-02 08:03:46.653: E/CameraService(66): CameraService::connect X (pid 1051) rejected (invalid cameraId 0).
05-02 08:03:46.660: E/CameraHolder(1051): fail to connect Camera
05-02 08:03:46.660: E/CameraHolder(1051): java.lang.RuntimeException: Fail to connect to camera service
05-02 08:03:46.660: E/CameraHolder(1051): at android.hardware.Camera.(Camera.java:497)
05-02 08:03:46.660: E/CameraHolder(1051): at android.hardware.Camera.open(Camera.java:342)
05-02 08:03:46.660: E/CameraHolder(1051): at com.android.camera.CameraHolder.open(CameraHolder.java:131)
05-02 08:03:46.660: E/CameraHolder(1051): at com.android.camera.Util.openCamera(Util.java:267)
05-02 08:03:46.660: E/CameraHolder(1051): at com.android.camera.Camera$4.run(Camera.java:1100)
05-02 08:03:46.660: E/CameraHolder(1051): at java.lang.Thread.run(Thread.java:818)
05-02 08:03:46.660: E/CameraHolder(1051): --------- beginning of crash
05-02 08:03:46.666: E/AndroidRuntime(1051): FATAL EXCEPTION: Thread-107
05-02 08:03:46.666: E/AndroidRuntime(1051): Process: com.android.camera, PID: 1051
05-02 08:03:46.666: E/AndroidRuntime(1051): java.lang.RuntimeException: openCamera failed
05-02 08:03:46.666: E/AndroidRuntime(1051): at com.android.camera.Util.openCamera(Util.java:272)
05-02 08:03:46.666: E/AndroidRuntime(1051): at com.android.camera.Camera$4.run(Camera.java:1100)
05-02 08:03:46.666: E/AndroidRuntime(1051): at java.lang.Thread.run(Thread.java:818)
05-02 08:03:46.666: E/AndroidRuntime(1051): Caused by: com.android.camera.CameraHardwareException: java.lang.RuntimeException: Fail to connect to camera service
05-02 08:03:46.666: E/AndroidRuntime(1051): at com.android.camera.CameraHolder.open(CameraHolder.java:135)
05-02 08:03:46.666: E/AndroidRuntime(1051): at com.android.camera.Util.openCamera(Util.java:267)
05-02 08:03:46.666: E/AndroidRuntime(1051): ... 2 more
05-02 08:03:46.666: E/AndroidRuntime(1051): Caused by: java.lang.RuntimeException: Fail to connect to camera service
05-02 08:03:46.666: E/AndroidRuntime(1051): at android.hardware.Camera.(Camera.java:497)
05-02 08:03:46.666: E/AndroidRuntime(1051): at android.hardware.Camera.open(Camera.java:342)
05-02 08:03:46.666: E/AndroidRuntime(1051): at com.android.camera.CameraHolder.open(CameraHolder.java:131)
05-02 08:03:46.666: E/AndroidRuntime(1051): ... 3 more
`
解决方法:
虽然这个问题已经过了一个月,但我只想提出解决方案,以便将来的用户可能会意识到这个问题.
我的笔记本相机驱动程序已锁定/不工作,因此无效.我连接了一台外置摄像头,但它确实有效.
所有选项与图像(问题)中显示的相同.
标签:android,android-emulator,avd,android-camera
来源: https://codeday.me/bug/20190702/1354547.html