Mostafa Efafi
Mostafa Efafi

Reputation: 795

Display an error while debug the flutter App in vscode

I can't debug my Flutter App in Vscode , and DEBUG CONSOL returned :

Unable to locate a development device; please run 'flutter doctor' for information about installing additional components.

I can show my emulator after run this :

flutter emulators

And i can run it :

flutter emulators --launch 4.7_WXGA_API_22

flutter doctor -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!

My operating system is Ubuntu 18.04 and i want to use emulator for debug , please help me.

Upvotes: 0

Views: 3740

Answers (2)

Mostafa Efafi
Mostafa Efafi

Reputation: 795

My problem was solved by this command

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

link

Upvotes: 1

Ritesh Sharma
Ritesh Sharma

Reputation: 77

You are having 3 options:

  1. You can open your emulator in Android Studio and after that debug your application from VSCode.

  2. You can also check whether adb(Android debugger bridge) is installed in your machine or not.

  3. Or else you can run your application in a real device.

Upvotes: 1

Related Questions