VS代码和Android Studio找不到模拟器

时间:2019-03-30 22:10:12

标签: android-studio flutter

Android Studio和VS代码都没有显示任何设备,但是flutter doctor没有显示任何问题,并且flutter run命令可以使应用正常运行

终端输出:

flutter doctor -v                                      
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
    • Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
    • Framework revision e5b1ed7a7f (vor 3 Wochen), 2019-03-06 14:23:37 -0800
    • Engine revision f4951df193
    • Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /home/nuggetz/Programme/android/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /home/nuggetz/Programme/android/
    • Java binary at: /opt/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)
    • All Android licenses accepted.

[✓] Android Studio (version 3.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[✓] Connected device (1 available)
    • Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27) (emulator)

• No issues found!

编辑:当我在Android Studio工具> Flutter> Flutter Doctor中运行时,我得到以下输出:

/home/nuggetz/Programme/flutter/bin/flutter doctor --verbose
[✓] Flutter (Channel beta, v1.3.8, on Linux, locale de_DE.UTF-8)
    • Flutter version 1.3.8 at /home/nuggetz/Programme/flutter
    • Framework revision e5b1ed7a7f (vor 4 Wochen), 2019-03-06 14:23:37 -0800
    • Engine revision f4951df193
    • Dart version 2.2.1 (build 2.2.1-dev.0.0 571ea80e11)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.io/setup/#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, set ANDROID_HOME to that location.
      You may also want to add it to your PATH environment variable.


[✓] Android Studio (version 3.3)
    • Android Studio at /opt/android-studio
    • Flutter plugin version 34.0.1
    • Dart plugin version 182.5215
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1248-b01)

[!] Connected device
    ! No devices available

! Doctor found issues in 2 categories.
Process finished with exit code 0

2 个答案:

答案 0 :(得分:0)

如果状态栏显示``没有设备'',则Flutter无法发现任何已连接的iOS或Android设备或模拟器。您需要连接设备或启动模拟器才能继续。

Flutter扩展程序自动选择最后连接的设备。但是,如果您连接了多个设备/模拟器,请在状态栏中单击设备以在屏幕顶部查看选择列表。选择要用于运行或调试的设备。

Flutter.dev

答案 1 :(得分:0)

只需将所有SDK从/ home / nuggetz / Programme / android /移至/ usr / lib / android-sdk