Android studio的模拟器有一个错误“无法连接到相机”

时间:2016-04-25 05:30:13

标签: android-studio

我通过在AVD Manager中将前置摄像头设置为“webcam0”,将网络摄像头连接到我的仿真器。 当我从Android studio的AVD管理器或使用模拟器 - 相机前置摄像头0启动网络摄像头时,我会看到以下窗口: enter image description here

当模拟器显示出错误时 enter image description here

请帮我解决这个问题。

7 个答案:

答案 0 :(得分:16)

转到Android虚拟设备管理器>>选择模拟器>>点击编辑>>选择高级设置>>相机选择为模拟而非网络摄像头。

如果这个答案对你有帮助,请upvote。

答案 1 :(得分:3)

对我来说,解决方案是:“通过命令行启动Android Studio,而以通常的方式启动”,这将使Webcam0在模拟器中运行。 在Mac上,我只需键入

/Applications/Android\ Studio.app/Contents/MacOS/studio

进入终端。稍后,我还使用Automator创建了运行脚本(上面的命令)的工作流,并将该工作流另存为应用程序。

使用这样的Android Studio launcher.app通过命令行为我启动Android Studio.app。

答案 2 :(得分:1)

我在新的Android模拟器上遇到此错误,并且能够通过选择前后相机的模拟选项并清除Camera App's 缓存和放大器来修复它;的数据即可。

答案 3 :(得分:1)

Android Studio: 工具> AVD管理器

enter image description here

选择设备,然后点击修改

enter image description here

点击显示高级设置

enter image description here

摄像机选择为网络摄像头0

enter image description here

点击>> 完成

答案 4 :(得分:0)

下载genymotion的免费个人使用版本并使用该模拟器,而不是Android Studio附带的模拟器。

和你一样,我一整天都在努力让我的网络摄像头与android studio附带的模拟器一起工作而没有成功。到目前为止,genymotion存在0个问题。

答案 5 :(得分:0)

就我而言,只需更改configuration -> saved -> turn on device (cold boot notification will appear) -> then turn off device -> revert change -> turn on again

我不知道,但这对我有用。也许只是缓存问题。 CMIIW。

答案 6 :(得分:-1)

但是如果您使用的是bluestack模拟器或任何其他模拟器。 然后在模拟器中首先打开模拟器相机,然后单击该照片 再次你自己在模拟器中的应用程序和相机的按钮..我必须工作..