Message "flutter run: No connected devices"
Asked Answered
H

62

380

I am trying to create a sample application with Flutter (fresh installation). Android Studio is also installed (fresh installation).

Here is the output of flutter run

flutter run
No connected devices.

The output of flutter doctor:

Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel beta, v0.1.5, on Linux, locale en_US.UTF-8)
[✓] Android toolchain - develop for Android devices (Android SDK 27.0.3)
[✓] Android Studio (version 3.0)
[!] VS Code (version 1.20.1)
[!] Connected devices
! No devices available

! Doctor found issues in 2 categories.

Is there a solution to this problem?

Heterogynous answered 1/3, 2018 at 8:22 Comment(10)
Do you have a device connected (USB debugging enabled) or an emulator running?Acidity
do flutter devices to check if flutter can find any devices or notFeet
"No connected devices" error usually means that you don't have enabled on your device the developer options.Vedi
For me this happens for about 1 minute then it seems to right itself. Android studio works fine immediately, but Flutter seems excessively slow at just about everything, including getting the emulator to be recognized. Maybe try some patience and come back after a cup of coffee?Haar
Check ADB is connected or notBentonbentonite
i came across this fix where you have to configure the android sdk and accept the licenses github.com/flutter/flutter/issues/22649#issuecomment-450020266Uneducated
While this is a smart question... it does not address the matrix of development machines and targets. Also there are different behaviors depending iTunes and the USB types. Very frustrating.Regatta
I had same problem, I've fixed by changing the USB Cable, because some cables are for power only.Dogoodism
Broaden it to other platforms? Many of the answers are for Windows and other platforms, even though the sample output indicates LinuxReremouse
For me, I needed to kill the android emulator. On Windows, the service is called "qemu-system-x86_64" in the Task ManagerSaith
S
282

Flutter supports both iOS and Android device/simulators.

In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device.

Here is a reference document on how you can set up a device/simulator to run your application.

For, Android (on a Mac system)

Set up your Android device

To prepare to run and test your Flutter app on an Android device, you’ll need an Android device running Android 4.1 (API level 16) or higher.

  1. Enable Developer options and USB debugging on your device. Detailed instructions are available in the Android documentation.
  2. Using a USB cable, plug your phone into your computer. If prompted on your device, authorize your computer to access your device.
  3. In the terminal, run the flutter devices command to verify that Flutter recognizes your connected Android device.
  4. Start your app by running flutter run.

By default, Flutter uses the version of the Android SDK where your ADB tool is based. If you want Flutter to use a different installation of the Android SDK, you must set the ANDROID_HOME environment variable to that installation directory.

Set up the Android emulator

To prepare to run and test your Flutter app on the Android emulator, follow these steps:

  1. Enable VM acceleration on your machine.
  2. Launch Android Studio → menu ToolsAVD Manager and select Create Virtual Device.
  3. Choose a device definition and select Next.
  4. Select one or more system images for the Android versions you want to emulate, and select Next. An x86 or x86_64 image is recommended.
  5. Under Emulated Performance, select Hardware - GLES 2.0 to enable hardware acceleration.
  6. Verify the AVD configuration is correct, and select Finish.

For details on the above steps, see Managing AVDs.

  1. In Android Virtual Device Manager, click Run in the toolbar. The emulator starts up and displays the default canvas for your selected OS version and device.
  2. Start your app by running flutter run. The connected device name is Android SDK built for <platform>, where platform is the chip family, such as x86.

Open & Connect Device using Android Studio:

Here is an easier way to open and connect simulators/devices.

Android Studio shows a list of emulators/simulators (installed in your system) or devices (connected to your system). Just select a device you want to open from a list, and run the project.

Enter image description here

Stunsail answered 1/3, 2018 at 17:16 Comment(8)
I can't get this to work. The emulator runs just fine. I can deploy and run an Android application to it. But the flutter project from Android studio keeps complaining that there's no emulator.Mackmackay
Same here, I get "No connected devices found; please connect a device, or see flutter.io/setup for getting started instructions." Meanwhile I can see the emulator sitting there on the same screen, up & running.Whop
{SOLVED} After a while I did an trial n error, I know exactly this problem is caused by corrupted adb file (by default "flutter devices" will call the "adb" file provided by the SDK, for example my adb.exe file exists in "C:\Android\Sdk\platform-tools "). the way to overcome this problem is to replace the file with the other adb file (make sure you have done a previous backup), you can replace your original adb with my adb file that you can download at the following link: gofile.io/?c=c0M3DC. ThanksTelegraphone
what about ios on mac? I have several macs and my 2012 MBA (USB-A) will only make the connection available if itunes is running. Connecting the same device to my 2019 MBA (USB-C) flutter does not recognize the device even though iTunes does,Regatta
My 2012 Macbook Air with USB-A can detect my iPhone5 but ONLY if I start iTunes. My 2019 Macbook Air with USB-C cannot detect the same iPhone5 (yes, trusted, and yes works in XCode and iTunes). My android phone works on both systems (no iTunes), however, on the 2019 MBA I need a USB-A/C dongle.Regatta
Solution for me about iOS: I had 2 Xcodes and by default, the android studio was pointing to 11.4 but it was opening the simulator from 11.3 (with lower version), I just opened a new simulator with version 11.4 and Android studio detected it.Isometric
So you have to open the emulator first and then start build process of the project. Why cant they work simultaneously in flutter like normal android project?Baku
Do I need the Android SDK to run flutter on a connected device?Dabber
L
219

Use:

flutter config --android-sdk ANDROID_SDK_PATH

Or

  • Device Not Found (when setting up Flutter in Android Studio)
  • Project structure -> select latest Android API in Project SDK

Enter image description here

Lobectomy answered 7/6, 2019 at 9:0 Comment(5)
By setting both the Project SDK and Module SDK fixed it. Thanks.Kubis
This solved my issue. I had running devices, but flutter was not able to detect them.Alten
Worked for me. No SDK was selectedCourtland
Thanks a lot! Looks like this happens if you just clone the project from version control, so the environment is not setup automatically.Tanta
In my case the Project Settings -> Project -> Project SDK had to match the Platform Settings -> SDKs -> Android API XX -> Build target.Shamekashameless
N
86

This was my solution:

My "Developer Options" was ON, but the "USB Debugging" was OFF.

So I turned ON the USB Debugging and the problem was solved.

Noahnoak answered 3/1, 2019 at 0:7 Comment(0)
C
55

None of the suggestions worked until I ran:

flutter config --android-sdk ANDROID_SDK_PATH

Use "ANDROID_SDK_PATH" = your path. For example:

flutter config --android-sdk C:\Users\%youruser%\AppData\Local\Android\Sdk
Carte answered 9/4, 2019 at 11:0 Comment(3)
After doing that got unable to locate Android SDKChequer
@eggrobot78 was able to address this by adding the Android SDK installation location as an environment path variable for ANDROID_HOME.Chamblee
By "PATH", do you mean "ANDROID_SDK_PATH"? Or something else? Can you elaborate? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).Reremouse
N
42

I solved the AVD problem with Flutter using the Flutter console.

Step 1:

C: \ Users \ valer> flutter emulators
6 available emulators:

3.2_QVGA_ADP2_API_22 _-_ Lollipop • 3.2in QVGA (ADP2) • Generic • 3.2 QVGA (ADP2) API 22 - Lollipop
Android_ARMv7a
Android_Accelerated_x86
Nexus S API Google Nexus S API 23
Nexus_S_API_25_1080x1920_Nougart_7.1.1_ • pixel • Google • Nexus S API 25 1080x1920 (Nougart 7.1.1)
Pixel_API_28 • pixel • Google • Pixel API 28

To run an emulator, run flutter emulators --launch <emulator id>.

Step 2:

C: \ Users \ valer> flutter emulators --launch Pixel_API_28
Nemhauser answered 12/6, 2018 at 15:8 Comment(1)
"Nougart"? Shouldn't it be Nougat? Was this the actual output (it already seems to have been manipulated)?Reremouse
H
37

In my case

Menu FileProject Structure

Select the latest SDK:

Enter image description here

Hoarse answered 21/8, 2019 at 11:46 Comment(2)
if there is no option project structure, restart android studioExcepting
It works when I select "Android API 30 Platform version 11.0.12".By the way, when I select Select "Android Studio default JDK version 11.o.12", it fail to find the device.Vaporous
E
23

I encountered the same problem as you did. It turns out that your device is not connected with your computer.

Note:

  • If you are using Xcode, if both your computer and the device are using the same Wi-Fi AP, you don't have to connect the device with the computer.
  • For Android, or iOS running under terminal command, if you are using command line to run this, you have to make sure they are connected via cables. Sharing the same Wi-Fi AP does not work. Make sure your device is really connected.
  • Make sure you allowed USB Debugging on your Android device.

If this still does not work, try to fire the below command, where you can get richer information and details:

flutter run --verbose
Embolic answered 1/3, 2018 at 8:30 Comment(1)
I've had the same issue, where VS Code can run Flutter but terminal can't. I wonder if there's an argument I'm missing that would make it work? It doesn't seem to make sense; I think VS Code or XCode commands would just serve as front ends for the CLI.Stephanstephana
V
23

What I needed to do:

flutter emulators

It will list all available emulators. For iOS you will need to open the simulator first.

flutter emulators --launch EMULATOR NAME

This will launch the emulator.

And to build it:

flutter run -d "EMULATOR ID"
Vitta answered 8/3, 2019 at 15:20 Comment(1)
Is the purpose of listing the emulators to get an emulator ID? Or something else? Can you make it more clear in your answer? Can you provide an example of an emulator ID? What does "it" refer to in "to build it"? What is built? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).Reremouse
U
15

I ran mine with Genymotion, probably the best for Flutter.

Setting up is less painful, but make sure setting ADB under:

Enter image description here

Your Andouird SDK path

Mine is C:\Users\user\AppData\Local\Android\Sdk.

Uniseptate answered 15/3, 2018 at 6:5 Comment(3)
Thanks. I reinstalled Genymotion and had to do this.Eyehole
Genymotion isis lighter.Yet
On Windows 10 I had to restart my computer before it worksRangel
A
15

I am using Linux and here are the steps that can help. First open Android Studio with root permissions, (Windows: Right-click the program icon → Choose Run As Administrator, Linux: sudo ./studio.sh in the terminal)

  1. Create emulator with Hardware - GLES 2.0 in hardware acceleration as mentioned here. Open a terminal in Android Studio (Alt + F12).

    Run command flutter devices and see the list devices:

    root@abc-OptiPlex-3050:~/flutter_workspace/my_app/my_app# flutter devices Woah! You appear to be trying to run flutter as root. We strongly recommend running the flutter tool without superuser privileges.

    1 connected device:

    Android SDK built for x86 • emulator-5554 • android-x86 • Android 8.1.0 (API 27)(emulator)

Finally run flutter run from the terminal:

root@abc-OptiPlex-3050:~/flutter_workspace/my_app/my_app# flutter run
   Woah! You appear to be trying to run flutter as root.
   We strongly recommend running the flutter tool without superuser privileges.


Using hardware rendering with device Android SDK built for x86.
If you get graphics artifacts, consider enabling software rendering
with "--enable-software-rendering".
Launching lib/main.dart on Android SDK built for x86 in debug mode...
Initializing gradle...                                       0.7s
Resolving dependencies...                                    1.2s
Running 'gradlew assembleDebug'...                           1.5s
Built build/app/outputs/apk/debug/app-debug.apk.
I/FlutterActivityDelegate(25096): onResume setting current activity to this
Syncing files to device Android SDK built for x86...
D/        (25096): HostConnection::get() New Host Connection established
0xe8487780, tid 25116
D/EGL_emulation(25096): eglMakeCurrent: 0xe5b3d8a0: ver 2 0 (tinfo 0xe84832f0)

🔥  To hot reload changes while running, press "r". To hot restart (and
rebuild state),press "R".An Observatory debugger and profiler on
Android SDK built for x86 is available at: http://127.0.0.1:8100/
For a more detailed help message, press "h". To quit, press "q".

And do check the flutter-sdk path in your project.Configure file from this answer.

  1. Set Project SDK of project from Project Structure

    File > Project Structure > Project SDK > "available sdk" > Apply

    set project sdk

Apollonius answered 20/7, 2018 at 9:40 Comment(0)
A
13

For Windows users,

Set the environment variable PATH for the Flutter SDK (...\flutter_windows_v0.2.8-beta.zip\flutter\bin)

No device connect

For more information, you can check blog post Flutter - How to install Flutter in Android Studio

Here is the information from the mentioned page:

Add Flutter to the Windows environment variable PATH:

  1. Navigate in to the Flutter SDK folder.
  2. Go inside the bin folder and copy the directory path (in your case C:\Flutter\bin)
  3. Go to “Control Panel > User Accounts > User Accounts > Change my environment variables”
  4. Under “User variables”, select the PATH variable and click Edit.
  5. Put C:\Flutter\bin and apply.

Same as the Flutter environment, we have to set the Android SDK path if it is on custom location.

  1. Navigate into the Android SDK folder.
  2. Copy the directory path (in your case ..AndroidStudioSDK\sdk)
  3. Go to Control Panel* → User AccountsUser AccountsChange my environment variables
  4. Under “User variables” select the PATH variable and click Edit.
  5. Enter ..AndroidStudioSDK\sdk with ANDROID_HOME and apply.

Tips:

If you facing the following issue,

1.[✗] Android toolchain - develop for Android devices ✗ Unable to locate Android SDK. Install Android Studio from https://developer.android.com/studio/index.html On the first launch, it will assist you in installing the Android SDK components. (or visit https://flutter.io/setup/#android-setup for detailed instructions).

If Android SDK has been installed to a custom location, set $ANDROID_HOME to that location.

You can resolve it with the following command.

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

  1. Error: Unknown argument --licenses

You can resolve it with the following command.

flutter -v doctor --android-licenses

Now, pick the emulator you want to use and click the green arrow to run the project. So, here default screen that is already designed.

Affectation answered 25/5, 2018 at 6:5 Comment(1)
..AndroidStudioSDK\sdk does not appear to be correct. Should it be ..\AndroidStudioSDK\sdk? Please respond (as approproate) by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).Reremouse
B
12

Android Studio -> Preferences -> Languages & Frameworks -> Dart

Make sure you enabled Dart support for the module (should be checked in)

enter image description here

Beeline answered 7/12, 2021 at 13:24 Comment(0)
P
10

I am facing the same issue with Flutter. But I found another way to work, i.e.,

  1. First run Android Emulator

  2. Then go to your Flutter Console

  3. Run the command flutter doctor, anf check whether your emulator is showing under connected devices tag, e.g.,

    Enter image description here

  4. Now move to your Flutter project path via the Flutter console. E.g., for me it is D:\FlutterWorkspace\flutter_demo

  5. Then run the flutter run command. E.g.,

    Enter image description here

    Wait for few moments. You will see your app running in the Android Emulator.

    Enter image description here

Pachisi answered 9/5, 2018 at 9:32 Comment(0)
J
10

If you have

  • Downloaded the Flutter SDK
  • Connected your mobile device and enabled the developer option on the mobile and allowed USB debugging.

And if you are still getting "No device connected" then I think you should install the ADB driver.

It worked for me!!

Click here to download

Jihad answered 4/7, 2018 at 2:37 Comment(0)
S
9

There should be at least one device/simulator connected to run Flutter applications.

Also make sure the USB debugging is enabled in developer settings.

Subalpine answered 7/3, 2018 at 11:39 Comment(0)
P
8

One option that I haven't see mentioned so far is that (for my setup) the Developer Option 'Select USB Configuration' must be set to MTP (Media Transfer Protocol).

Parks answered 16/5, 2018 at 13:51 Comment(1)
All: What is the explanation?Reremouse
R
6

The actual answer did not work for me.

But setting ANDROID_HOME in your ~/.bash_profile file, logging out, and then logging in, makes it work!

This may be an Android Studio issue since it is not setting this environment variable for the open projects.

Revision answered 9/9, 2018 at 16:5 Comment(0)
M
6

Follow these step:

Menu File -> Project Structure -> Project SDK(Select the SDK Path in the Android SDK) -> OK

Make sure your device is connected to the PC.

Open Git Bash and type:

flutter devices

Then run your Flutter app. It will work.

Moats answered 21/5, 2019 at 12:23 Comment(0)
O
5

I had the same problems while I was debugging with a local Flutter engine. In such case, if you have set environment variable FLUTTER_ENGINE, you should unset it and restart you IDE.

Osyth answered 18/7, 2018 at 11:23 Comment(0)
B
5

Step 1: To check the connected devices, run: flutter devices

Step 2: If there aren't any connected devices to see in the list of available emulators, run: flutter emulators

Step 3: To run an emulator, run: flutter emulators --launch <emulator id>

Step 4: If there is no available emulator, run: flutter emulators --create [--name xyz]

==> For Android:

Step 1: To check the list of emulators, run: emulator -list-avds

Step 2: Now to launch the emulator, run: emulator -avd avd_name

==> For iOS:

Step 1: open -a simulator

Step 2: flutter run (in your app directory)

Belly answered 20/3, 2020 at 5:11 Comment(0)
A
4

None of the above solutions worked for me, but I was able to solve it by invalidating catch and restarting my Android Studio:

Menu FileInvalidate Catches / Restart...

EDIT:::

To clear Android Studio’s cache and bring it out of its state of confusion

select ‘File > Invalidate Caches / Restart’ and then click the ‘Invalidate and Restart’ button.

Clean and rebuild your project.

Acevedo answered 11/12, 2018 at 11:29 Comment(2)
What do you mean by "invalidating catch"? Can you elaborate?Reremouse
By "Invalidate Catches" you'll be removing the virtual file system cache together with the information stored in Local History. This action might be helpful for troubleshooting purposes as the IDE caches information about your project’s structure.Acevedo
R
4

Flutter needs a device to run the app. There are two choices for this.

  1. Run the app on your real phone.
  2. Run the app on a virtual device in your computer.

I would recommend Option 1 because it doesn't use your device resources and is faster.

Option 1:

Unlock developer options on your phone, go to developer setting and turn on USB debugging and connect your phone to your computer. Now run flutter run and it will work.

Option 2:

Open Android Studio, go to AVD Manager, add a virtual device if you haven't done that yet and run the virtual device. Now run flutter run again and it should work.

Note that this way works with any virtual device and not just virtual device from Android Studio.

Ribbonwood answered 2/4, 2019 at 13:28 Comment(0)
S
4

I solved the problem after changing "ANDROID_HOME" to the Environment variables and setting it to the location of your Android SDK...in my case C:\Android\Sdk.

Sweeten answered 4/4, 2019 at 16:40 Comment(1)
What do you mean by "changing "ANDROID_HOME" to the Environment variables"? Can you elaborate? Please respond by editing your answer, not here in comments (without "Edit:", "Update:", or similar - the answer should appear as if it was written today).Reremouse
S
3

NOTE: I am using a Mi (Xiaomi) mobile (Redmi K20 Pro) which is running on Android 10

You need to do two things to show your device listing.

  1. Go to your Android Studio, menuFileProject Structure and choose the project SDK from the options. I chose the latest one from the menu.

  2. When you connect your real device to your PC/laptop, make sure you choose Transfer photos (PTP) mode.

NOTE: Don't choose File transfer mode. It will not work.

After doing the above two things, you can check the status of your device availability by writing flutter devices on the command prompt.

I hope it shows your mobile device.

Shortage answered 10/11, 2019 at 16:37 Comment(0)
T
3

I had the same issue. Setting up the Android SDK is also a correct answer. But this is very simple -

  1. Import an Android project to a new Android Studio window.
  2. Close your current Flutter project Android Studio window.
  3. Import that Flutter project to a new Android Studio window.
Tillie answered 3/5, 2020 at 1:34 Comment(0)
M
2

For Windows users,

The solution for me was running Android Studio as administrator

Marriageable answered 22/10, 2018 at 1:32 Comment(0)
D
2

It basically needs a device "connected" to your development machine. If you're using a simulator/emulator running on the machine it should automatically be recognised as a connected device. Another way is to connect a physical device and the setup process varies slightly for Android and iOS devices.

Discernible answered 13/1, 2019 at 16:34 Comment(0)
M
2

For me it was

  1. adding "ANDROID_HOME" to the Environment variables and setting it to D:\dev\android\ (for me)

  2. adding "D:\dev\android\platform-tools" (for me) to environment variable PATH. I put flutter there before

  3. OK, OK, OK. Restart Android Studio

Matrilocal answered 27/2, 2019 at 0:34 Comment(1)
What do you mean by "I put flutter there before"?Reremouse
W
2

In my case, flutter devices showed my device correctly and flutter run worked as expected. But the device is not shown in Android Studio.

Here is my solution:

In my .bash_profile, the Android SDK is configured like this:

export ANDROID_SDK_ROOT="~/Library/Android/sdk"

It seems the Flutter plugin can not recognise the ~, so I changed it to this way:

export ANDROID_SDK_ROOT="/Users/charliema/Library/Android/sdk"

Reopen Android Studio. It worked.

Wera answered 11/4, 2019 at 15:3 Comment(0)
S
2

In iOS with Mac, when I got this error, this worked for me:

open -a simulators
flutter run
Stringy answered 4/6, 2019 at 21:58 Comment(1)
should be open -a Simulator && flutter runPetromilli
D
2

You could try

flutter emulators

to show a list of already-created emulators.

Today, this shows me the two emulators in the list below.

Nexus_6_API_27 • Nexus 6 API 27 • Google • android

Pixel_2_API_27 • Pixel 2 API 27 • Google • android

You can then use something like

flutter emulators --launch Nexus_6_API_2 to start the emulator of choice

You can then use flutter run to test your app.

I use Visual Studio Code and tend to do use this approach which saves me having to load Android Studio to launch an emulator.

Dost answered 10/10, 2019 at 13:47 Comment(0)
B
2

I was using Visual Studio Code on a Mac and was trying to run the Flutter code on my iPhone. The device was not showing up in the status bar. I fixed the issue by doing this in the Terminal:

rm -rf <flutter_repo_directory>/bin/cache
flutter doctor -v

This will basically clear all the cache data from the Flutter repository folder. So when you run flutter doctor it will download some files initially.

Balderas answered 15/10, 2019 at 14:41 Comment(1)
My iPhone can't recognize by flutter on the mac system. tried many ways, yours works well.Thanks~Frier
O
2

This works for me:

Go to Settings > Developer options > Disable USB debugging > Re-enable USB debugging

Onomastic answered 2/6, 2020 at 10:1 Comment(0)
A
1

Sometimes the issue is with the device connection and its driver.

If you already turned on the Developer Option and USB debugging and still are unable to connect your device, you must try this one as it's officially from Google.

Install OEM USB drivers:

Install OEM USB drivers

Averill answered 5/2, 2019 at 10:24 Comment(0)
E
1

You can see connected devices if you start the simulator manually on a Mac and the Android emulator from AVD Manager as well.

Escalate answered 19/3, 2019 at 11:33 Comment(0)
E
1

I had an emulator running, but the Visual Studio Code IDE could not connect to it. So I enabled developer mode in the emulator and the debugging options as well. Voilà, it worked!

Eigenfunction answered 25/3, 2019 at 8:45 Comment(0)
V
1

If the emulator is running and is not being detected by the flutter and adb devices then try connecting it manually by using the following command

abd connect 127.0.0.1:62001

If it fails to connect, try again. The following message should appear

connected to 127.0.0.1:62001

Then try flutter doctor or adb devices to make sure it has been connected successfully.

Vergne answered 16/5, 2019 at 20:20 Comment(1)
in my case i havent launched emulator .once launching emulator u can run the appPeag
I
1

I'm using Genymotion for testing apps. I have the same problem. When I press the run button I face this error the last two hours...

Enter image description here

How to fix this error: Just reinstall Genymotion this error is gone.

Inlet answered 26/5, 2019 at 16:57 Comment(0)
T
1

If you are using mobile,

  • Turn on your developer options.

  • Turn on USB debugging option

Therapist answered 12/3, 2020 at 20:55 Comment(0)
A
1

If your device was already connected successfully, and just suddenly stopped being recognized by flutter devices (and Android Studio for that matter), this worked for me:

  • Turn USB debugging OFF
  • Turn USB debugging back ON

Yup. This worked. For me.

Alix answered 25/3, 2020 at 15:11 Comment(0)
D
1

Open the terminal in Visual Studio Code, and write the below commands:

flutter devices

flutter daemon -v

After that, connect using cmd:

cd (ADB folder)

adb tcpip 4455
adb connect 192.168.1.11:4455 (use your device IP address)
Dwarf answered 15/6, 2020 at 18:21 Comment(0)
M
1

If you have already installed and set up your emulator, but you are facing the issue during running your app, you can try these steps to fix this issue.

Steps:

  1. Open Android Studio
  2. Menu ToolsAVD Manager
  3. Virtual DeviceActions (Refer Image)
  4. Click on Stop
  5. Now start the emulator

Note - if it's still not working, try the 4th step again by wiping your data.

Moreno answered 23/7, 2020 at 10:5 Comment(0)
C
1

Setting the System environment variable:

Variable Value
ANDROID_HOME D:\Android_Sdk\Sdk (your path)
Cocainize answered 29/9, 2020 at 10:24 Comment(1)
Presumably for Windows?Reremouse
J
1

Solution most times is to enable Dart support on android studio. Preferences > Languages and framework > Dart

Ensure Dart support is enabled for your flutter project.

Jugate answered 24/12, 2022 at 0:0 Comment(0)
W
1

Exit and start Android Studio again can solve the issue.

Whacking answered 22/9, 2023 at 18:54 Comment(0)
T
0

Try running Android Studio as administrator if your Flutter SDK location is in the C drive.

Tigges answered 5/5, 2019 at 10:17 Comment(0)
W
0

I found that my antivirus software (Avast) had quarantined the adb.exe file. I went to Avast -> protection -> virus chest. Removed the adb.exe file from the list.

Then added the Android_home variable + added it to the PATH variable. I restarted my machine and Android Studio picked up the device/emulator.

Woodsum answered 26/5, 2019 at 8:2 Comment(0)
M
0
  1. Please check if you have two Android versions installed, if yes uninstall it as two versions can’t run at the same time.
  2. Also, you may try to set android-sdk in the flutter config where you can deploy directly to devices from Android Studio
Moltke answered 16/8, 2019 at 9:7 Comment(0)
C
0

While using it in Windows 7, I had received an error: unable to install device drivers. And the device wasn't recognised.

You need to also install the Android OEM device driver for the particular device, just like mentioned here.

I downloaded the driver for the device from the manufacturer's website and installed the driver from Device Manager.

Coop answered 5/9, 2019 at 7:22 Comment(0)
C
0

If there is a problem with ADB Interface driver:

enter image description here

Try to find an appropriate driver on manufacturer's web-site. For Intel read this Installing the Android Debug Bridge (ADB) USB Driver on a Windows Computer.

Commendation answered 4/10, 2019 at 22:55 Comment(0)
V
0

If you are using Windows, press Control + Alt + Delete and select Dart Task inside Android Studio and click End Task.

I tried many times, and it works.

Viens answered 14/1, 2020 at 17:16 Comment(0)
B
0

I recently faced the same problem. I am using macOS and the iOS simulator. The flutter devices command shows No devices detected.

'flutter devices' command

Then I run the flutter doctor command and it says my Xcode installation is incomplete,

But it's not true (I verify it by building native iOS app and it runs well)!

'flutter doctor' command

I didn't reinstall/download Xcode again. I just ran those two commands according to their suggestions:

sudo xcode-select --switch /Applications/Xcode.app/Contacts/Developer
sudo xcodebuild -runFirstLaunch

And it solves my problem. Here is the final flutter doctor command output.

'flutter doctor' command

Baccy answered 17/2, 2020 at 16:2 Comment(0)
M
0

This is my solution.

First connect the device to the laptop and in mobile, open settings of the smartphone and search for Developer Options and click on it and enable USB Debugging on your device.

Then open the project and open the terminal and type "flutter run"

By doing so your device is recognized.

Then set up your Android Emulator.

In Android Studio, at the top, there will be no devices option. Click on that and proceed to select your device, wait for a few minutes, and you can see your app on your smartphone or on the emulator as per your selected Android emulator.

Mitchum answered 21/2, 2020 at 15:57 Comment(0)
R
0

Check ADB is running or not. If not, run using the below command:

adb start server

And then

adb devices

If ADB is not installed in your machine, install it and run commands again.

Reddish answered 12/3, 2020 at 13:14 Comment(0)
R
0

I tried a lot of the recommended steps listed here but the only thing it helps me was this:

File -> Settings -> Language & Support -> Dart -->

Activate the checkbox "Enable Dart support for the project ..."

enter image description here

Ruthenic answered 13/3, 2020 at 8:45 Comment(0)
L
0

Just my case. I haven't found this solution among the answers.

System

Android 10 device.

Mac with macOS v10.14.6 (Mojave, 18G4032).

Developer options and USB debugging were enabled on my Android device.

Flutter SDK was installed on my Mac.

Problem

When the Android device had been connected to my Mac with the USB cable, the flutter devices command still stated: No devices available.

Solution

Fortunately, my Android device showed me the popup with the suggestion to install Android File Transfer on my Mac.

After installing the Android File Transfer on my Mac, the flutter devices command showed my Android device as connected.

Lavadalavage answered 17/5, 2020 at 6:55 Comment(0)
N
0

Basically there are three common causes for this problem:

1. You don't have the ADB drivers installed on your computer. Make sure you have the correct ADB drivers for your Android device installed on your PC.

Even if your computer reads your device, you may not have the ADB drivers installed. I recommend that you search and download the correct ADB drivers for your Android device from Google or download an ADB package. If you install an ADB and it doesn't work, try installing another ADB, as it is common that not all ADBs work.

If you're on Windows, when you've installed the correct ADB drivers, maybe the O.S. run Windows Update to complete the ADB installation.

2. Your device does not have debugger mode enabled. It depends on each version of Android. Generally, on your Android device, you have to go to the configuration menu, then open the developer options, activate the debugger mode, enable OEM unlocking and USB debugger. Also make sure you allow the developer to sign on your device

3. Incorrect cable or other physical problems.

Sometimes the problems are caused by the data transfer cable. Try using other cables.

Nevernever answered 2/6, 2020 at 7:55 Comment(1)
In some cases the operative system installs automatically the ADB driversNevernever
A
0

In case you want to test you app on your physical device via Wi-Fi:

1.) Connect your device via USB (make sure developer options and USB debugging are enabled) 2.) Type in your Android Studio terminal: adb tcpip 5555 3.) Remove the USB connection 4.) Type in your Android Studio terminal: adb connect <IP address of your device>

Alternatively, you can use the Wi-Fi ADB extension for Android Studio. I don't know any similar extension for Visual Studio Code.

Ampulla answered 15/6, 2020 at 16:5 Comment(0)
G
0

No one here mentions to make sure the Android device is not connected as "Media device". As soon as I turned this off and set it to "Charging", it worked.

I obviously installed the USB driver through Android Studio, and also went through a step of adding "adb" to my system path by adding the location of it to "PATH".

Gawain answered 29/1, 2021 at 8:30 Comment(0)
A
0

MacOS solution: I have scanned through all the answers and did find my solution. As far as I remember there was a problem with .bas_profile, .zshrc and other config files synchronization. So in order to make them synchronize run Android Studio from terminal, for example:

open /Applications/Android\ Studio\ 2.app

Ambrosius answered 1/2, 2022 at 14:49 Comment(0)
D
0

I encountered the same problem as you experienced. It turns out that your device is not connected to your computer. What I did was actually just

flutter emulators

then Specially perform a cold boot things will get back to their place most probably. All the Best coder.

Debarath answered 15/4, 2022 at 16:20 Comment(0)
E
-4

Just execute the below command in a terminal before running:

open -a Simulator
Excerpta answered 11/4, 2020 at 13:58 Comment(3)
Is "Simulator" literal?Reremouse
open -a Simulator The above command will open iOS Simulator from mac TerminalExcerpta
This won't solve the problem above. This will open a simulator on a Mac machine.Animatism

© 2022 - 2024 — McMap. All rights reserved.