我试图用Flutter创建一个示例应用程序(新安装)。还安装了Android Studio(新安装)。

这是颤振运行的输出

flutter run
No connected devices.

颤振医生输出:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[!] VS Code (version 1.20.1)
[!] Connected devices
! No devices available

! Doctor found issues in 2 categories.

这个问题有解决办法吗?


当前回答

遵循以下步骤:

菜单文件->项目结构->项目SDK(在Android SDK中选择SDK路径)-> OK

确保您的设备已连接到PC。

打开Git Bash并输入:

flutter devices

然后运行你的扑动应用程序,会有用的。

其他回答

到目前为止,我还没有看到提到的一个选项是(对于我的设置)开发人员选项“选择USB配置”必须设置为MTP(媒体传输协议)。

它基本上需要一个设备“连接”到您的开发机器。如果你在机器上使用模拟器/仿真器,它应该自动被识别为连接设备。另一种方法是连接物理设备,Android和iOS设备的设置过程略有不同。

我用Flutter控制台解决了AVD问题。

步骤1:

C: \ Users \ valer> flutter emulators
6 available emulators:

3.2_QVGA_ADP2_API_22 _-_ Lollipop • 3.2in QVGA (ADP2) • Generic • 3.2 QVGA (ADP2) API 22 - Lollipop
Android_ARMv7a
Android_Accelerated_x86
Nexus S API Google Nexus S API 23
Nexus_S_API_25_1080x1920_Nougart_7.1.1_ • pixel • Google • Nexus S API 25 1080x1920 (Nougart 7.1.1)
Pixel_API_28 • pixel • Google • Pixel API 28

要运行模拟器,请运行flutter模拟器——launch <模拟器id>。

步骤2:

C: \ Users \ valer> flutter emulators --launch Pixel_API_28

在Windows 7中使用它时,我收到了一个错误:无法安装设备驱动程序。这个装置没有被认出来。

您还需要为特定的设备安装Android OEM设备驱动程序,就像这里提到的那样。

我从制造商的网站上下载了该设备的驱动程序,并从设备管理器中安装了驱动程序。

在将“ANDROID_HOME”更改为环境变量并将其设置为Android SDK的位置后,我解决了这个问题…在我的情况下C:\Android\Sdk。