Android studio - flutter:没有连接的设备 [英] Android studio - flutter: No Connected Devices
问题描述
我刚开始使用flutter进行移动开发,尝试运行默认的flutter程序时出现这个错误.
I have just started with mobile development using flutter, and there is this error when trying to run the default flutter program.
未找到连接的设备;请连接设备,或查看flutter.dev/setup 入门说明.
No connected devices found; please connect a device, or see flutter.dev/setup for getting started instructions.
这是一台 Windows 10 x64 机器.
This is a Windows 10 x64 machine.
在 -
D:\Program Files\Android\Android Studio1
从 Android Studio 安装了 Android SDK -
D:\Android\android-sdk
Installed Android SDK from Android Studio in -
D:\Android\android-sdk
设置这些系统环境变量
ANDROID_HOME - D:\Android\android-sdk;D:\Android\android-sdk\tools;D:\Android\android-sdk\build-tools;D:\Android\android-sdk\platform-tools
ANDROID_HOME - D:\Android\android-sdk;D:\Android\android-sdk\tools;D:\Android\android-sdk\build-tools;D:\Android\android-sdk\platform-tools
ANDROID_SDK_ROOT - D:\Android\android-sdk;D:\Android\android-sdk\tools;D:\Android\android-sdk\build-tools;D:\Android\android-sdk\platform-tools
ANDROID_SDK_ROOT - D:\Android\android-sdk;D:\Android\android-sdk\tools;D:\Android\android-sdk\build-tools;D:\Android\android-sdk\platform-tools
已安装 Nexus 6 API 28 设备和将仿真性能图形设置为硬件 GLES-2.0
Installed Nexus 6 API 28 device & set Emulated Performance Graphics to Hardware GLES-2.0
已安装
pie Android 9.0 x86
&pie Android 9.0 x86_64
因为我不确定使用哪个.AVD 模拟器在两个操作系统上都可以正常启动.(使用哪个?)Installed
pie Android 9.0 x86
&pie Android 9.0 x86_64
as I was unsure which one to use. The AVD emulator launches fine with both the OS. (Which one to use?)在 -
D:\Flutter\flutter
当我运行 main.dart 时,它显示这个错误:
When I run main.dart, it shows this error:
当我在 Android Studio 中运行 flutter doctor 时,它显示了 2 个问题:
When I run flutter doctor in the Android Studio it shows 2 issues:
[X] Android toolchain - develop for Android devices X ANDROID_HOME = D:/Android/android-sdk but Android SDK not found at this location. [!] Connected device ! No devices available
当我尝试从 flutter 目录在 powershell 中运行命令时,出现此错误:
When I try to run a command in powershell from the flutter directory, it gives this error:
推荐答案
在环境变量中 >用户变量,添加一个新的PATH,如:C:\src\flutter\bin
In environment variables > User Variables, add a new PATH, like: C:\src\flutter\bin
然后重启你的机器.
这篇关于Android studio - flutter:没有连接的设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!