Flutter无法找到虚拟设备

时间:2018-12-08 13:37:06

标签: android android-studio flutter avd

我对Flutter有问题。我在Ubuntu 18.04上使用Android Studio 3.2.1。我无法使其找到我的虚拟设备。

当我运行flutter doctor时,显示以下输出:

$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.11.10-pre.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] Android Studio (version 3.2)
[!] Connected device

! Doctor found issues in 1 category.

当我运行flutter emulators时,它会找到设备:

$ flutter emulators
1 available emulator:

Nexus_5X_API_28 • Nexus 5X • Google • Nexus 5X API 28

To run an emulator, run 'flutter emulators --launch <emulator id>'.
To create a new emulator, run 'flutter emulators --create [--name xyz]'.

然后我可以运行flutter emulators --launch Nexus_5X_API_28来启动模拟器。它将按预期打开。

再次运行flutter doctor时,仍然找不到该设备:

    $ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel master, v0.11.10-pre.3, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 28.0.3)
[✓] Android Studio (version 3.2)
[!] Connected device

! Doctor found issues in 1 category.

当我尝试从设备下拉窗格中启动仿真器时,也会发生同样的事情。我可以选择Open Android Emulator: Nexus 5X API 28,它将打开设备,但在模拟器启动后仍显示<No Devices>

任何帮助都将不胜感激!

1 个答案:

答案 0 :(得分:0)

感谢@Feu对上述问题的评论,我发现问题出在以下方面:

解锁后,我必须在虚拟设备上进行一些设置。我没有注意到这一点,但是运行flutter doctor -v可以使一切变得清楚:

[!] Connected device
• Device emulator-5554 is not authorized.
  You might need to check your device for an authorization dialog.