【问题标题】:Display an error while debug the flutter App in vscode在vscode中调试flutter App时显示错误
【发布时间】:2019-12-06 10:02:26
【问题描述】:

我无法在 Vscode 中调试我的 Flutter App,并且返回了 DEBUG CONSOL:

无法定位开发设备;请运行“颤振医生” 有关安装其他组件的信息。

运行后我可以显示我的模拟器:

颤振模拟器

我可以运行它:

flutter 模拟器 --launch 4.7_WXGA_API_22

颤振医生 -v :

[✓] Flutter (Channel stable, v1.7.8+hotfix.4, on Linux, locale en_US.UTF-8)
    • Flutter version 1.7.8+hotfix.4 at /home/ZZZ/Dev/Flutter/flutter
    • Framework revision 20e59316b8 (10 days ago), 2019-07-18 20:04:33 -0700
    • Engine revision fee001c93f
    • Dart version 2.4.0


[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /media/ZZZ/B0B8B687B8B64C1A/Dev_ubuntu/android-sdk-linux/
    • Android NDK location not configured (optional; useful for native profiling support)
    • Platform android-28, build-tools 28.0.3
    • ANDROID_HOME = /media/ZZZ/B0B8B687B8B64C1A/Dev_ubuntu/android-sdk-linux/
    • Java binary at: /usr/local/android-studio/jre/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)
    • All Android licenses accepted.

[✓] Android Studio (version 3.4)
    • Android Studio at /usr/local/android-studio
    • Flutter plugin version 37.1.1
    • Dart plugin version 183.6270
    • Java version OpenJDK Runtime Environment (build 1.8.0_152-release-1343-b16-5323222)

[✓] VS Code (version 1.36.1)
    • VS Code at /usr/share/code
    • Flutter extension version 3.2.0

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

• No issues found!

我的操作系统是 Ubuntu 18.04,我想用模拟器调试,请帮帮我。

【问题讨论】:

    标签: debugging flutter visual-studio-code android-emulator vscode-debugger


    【解决方案1】:

    这个命令解决了我的问题

    flutter config --android-sdk <sdk-location>
    

    link

    【讨论】:

      【解决方案2】:

      您有 3 个选项:

      1. 您可以在 Android Studio 中打开您的模拟器,然后从 VSCode 调试您的应用程序。

      2. 您还可以检查您的机器上是否安装了adb(Android debugger bridge)。

      3. 否则您可以在真实设备上运行您的应用程序。

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2020-10-23
        • 1970-01-01
        • 2022-01-11
        • 2020-03-09
        • 2021-03-25
        • 2018-09-06
        • 2020-08-24
        相关资源
        最近更新 更多