Android studio - flutter: No Connected Devices

5,669

Solution 1

In environment variables > User Variables, add a new PATH, like: C:\src\flutter\bin

Then restart your machine.

Solution 2

I think the error in the powershell means you did not add the Flutter SDK to your PATH as stated in the install documentation.

First follow the install documentation to add the Flutter SDK to your PATH, then close any PowerShell windows you have.

Open an emulator.

Open a PowerShell window.

Try to create a test project via the PowerShell like so

flutter create <project name>
cd <project name>
flutter run
Share:
5,669
Qwerty
Author by

Qwerty

Updated on November 18, 2022

Comments

  • Qwerty
    Qwerty about 1 month

    I have just started with mobile development using flutter, and there is this error when trying to run the default flutter program.

    No connected devices found; please connect a device, or see flutter.dev/setup for getting started instructions.

    • This is a Windows 10 x64 machine.

    • Installed Android Studio in - D:\Program Files\Android\Android Studio1

    • Installed Android SDK from Android Studio in - D:\Android\android-sdk

    • Set these system environment variables

      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

    • Installed Nexus 6 API 28 device & set Emulated Performance Graphics to Hardware GLES-2.0

    • 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?)

    • Installed flutter in - D:\Flutter\flutter

    When I run main.dart, it shows this error:

    enter image description here

    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
    

    When I try to run a command in powershell from the flutter directory, it gives this error:

    enter image description here