我在Windows 10中以管理员身份运行Android工作室.AVD是一个Nexus 5X API 28.我正在尝试运行flutter演示,但设备下拉框仍然显示“没有设备”,它只有“打开Android Emulator“选项,我点击它启动AVD:
的输出
扑医生-v
是:
[√] Flutter (Channel stable, v1.0.0, on Microsoft Windows [Version 10.0.17134.407], locale en-US)
• Flutter version 1.0.0 at C:\Users\User\flutter_windows_v1.0.0-stable\flutter
• Framework revision 5391447fae (10 days ago), 2018-11-29 19:41:26 -0800
• Engine revision 7375a0f414
• Dart version 2.1.0 (build 2.1.0-dev.9.4 f9ebf21297)
[√] Android toolchain - develop for Android devices (Android SDK 28.0.3)
• Android SDK at C:\Users\User\AppData\Local\Android\sdk
• Android NDK location not configured (optional; useful for native profiling support)
• Platform android-28, build-tools 28.0.3
• Java binary at: C:\Program Files\Android\Android Studio\jre\bin\java
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
• All Android licenses accepted.
[√] Android Studio (version 3.2)
• Android Studio at C:\Program Files\Android\Android Studio
• Flutter plugin version 31.1.1
• Dart plugin version 181.5656
• Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1136-b06)
[!] Connected device
• Device emulator-5554 is not authorized.
You might need to check your device for an authorization dialog.
! Doctor found issues in 1 category.
与通过USB连接的真实手机不同,此处在启动AVD时没有授权对话框 . 我该如何授权手机?
2 回答
您应该将ANDROID_HOME变量添加到class_path
取自this
在那之后召唤医生-v和颤振设备
This simple solution工作:擦除数据和冷启动 .
没工作:
请注意,在Android工作室的终端中,无法识别
adb
(遵循颤动的安装说明) . 您可以将android SDK位置路径添加到PATH环境变量,只是为了能够运行adb
,但这不会提供比flutter doctor -v
更多的信息 . android SDK路径应该已经在Tools | SDK Manager中,在我的情况下"C:\Users\User\AppData\Local\Android\Sdk",与"android-sdk-windows"无关 . 杀死并重新启动adb
无法正常工作 .Logcat显示消息“请配置Android SDK”(单击“配置”,打开“项目结构”窗口) . SDK和默认JDK的路径是有效的 . 安装NDK错误配置了其他内容,因此我将其卸载并将此路径字段留空 . 在“项目”下,所有版本和存储库字段都为空 .