Léo Coletta
Léo Coletta

Reputation: 1269

Android Studio device list stuck on loading

I'm trying to add a virtual phone to the device list, however, the device list is stuck on loading.

StuckLoading

I use the default nexus 5 device on AVD:

AVDConfiguration

I am on Windows 10 and trying to set up Flutter.

Upvotes: 64

Views: 113899

Answers (30)

tsukimi
tsukimi

Reputation: 1645

Went from Intel to Apple Silicon mac, using migration assistant, need to reinstall the platform tools to update ADB.

Upvotes: 0

WitWicky
WitWicky

Reputation: 291

If you are using a Mac, follow these steps to resolve the issue with Android Studio not showing the emulator/device name:

Open Activity Monitor: You can find this by opening Spotlight Search (Cmd + Space) and typing "Activity Monitor."

Check for ADB Instances: Look for any instances of adb (Android Debug Bridge) that might be running. It’s common to have multiple instances running, which can cause conflicts.

Force Quit ADB: Select each adb process and click on the 'X' button in the top-left corner of the Activity Monitor window to force quit them.

Restart Android Studio: After force quitting all adb processes, restart Android Studio. By doing this, Android Studio should now be able to detect the running emulator or connected device.

Upvotes: 1

Usama Baig
Usama Baig

Reputation: 31

Try this simple manual refresh:

Press Shift twice to open the global search in Android Studio. Type Refresh in the search bar. Look for the "Refresh" option that appears with a Flutter icon. Click on it, and it should refresh your project. This manual refresh can help in cases where the device list is not updating or is stuck, as it forces the IDE to reload its state. It worked for me, and I hope it helps others facing a similar issue!

Upvotes: 0

dvm
dvm

Reputation: 31

On October 15th, I had this issue.

  1. I went to Tools > Device Manager and noticed my attached device was not showing.
  2. From there I went to my attached device, went to the notifications shade selecting the Android System USB notification.
  3. I then turned on the "File Transfer / Android Auto" option under the "USE USB FOR" section of the USB Preferences setting menu.

This fixed the "loading devices" issue for me. I am only posting my answer because while I am sure the ADB kill option may work, my solution kept me from rebooting anything. If you are Linux fan boi like me then you know its all about up time. Also my answer had not been posted yet and so I figured it provide someone seeking a solution more context in their journey.

Upvotes: 1

prasanna
prasanna

Reputation: 256

Restart the ADB . navigate to your platform-tools path and type the below command .

./adb kill-server ./adb start-server

or in MAC open Activity monitor and search for adb in search bar and close button click and force quit now you can able to see the connected devices

Upvotes: 10

Ashvin
Ashvin

Reputation: 9007

For me solution is

I have moved project from one Machine/Computer to another Machine, so Dart path was wrong.

So I have updated Dart path as per new location in new machine.enter image description here

Upvotes: 1

Abd Alazeez
Abd Alazeez

Reputation: 156

On Ubuntu I used

adb kill-server

This fixed the problem.

Upvotes: 0

Seyed Hussein Mirzaki
Seyed Hussein Mirzaki

Reputation: 361

I can resolve this by running following commands in command line.

$ adb kill-server
cannot connect to daemon at tcp:5037: cannot connect to 127.0.0.1:5037: No connection could be made because the target machine actively refused it. (10061)

yes it will throw an error and it means we are good to go

then you should call following command so the adb stuff start to work again

adb devices

Upvotes: 1

Saurabh Padwekar
Saurabh Padwekar

Reputation: 4074

Just Restart your laptop/desktop.

Upvotes: 4

Ali Nem
Ali Nem

Reputation: 5550

None of the answers on this page works for Apple M1 cpus. On Apple M1 chips the adb command does not work because it is not built for the Apple silicon. So that needs to be translated first to be runnable on the Apple chip. This is what Rosetta 2 does. To install it manually you can do this in the terminal (Thanks to this answer):

softwareupdate --install-rosetta

followed by

invalidate cache and restart

Upvotes: 0

Adnan Bashir
Adnan Bashir

Reputation: 763

Its 100% worked for me

step 1- turned OFF your Wi-Fi

step 2- open C:\Users\abcdcomputer\AppData\Local\Android\Sdk\platform-tools

enter image description here

step 3- open command prompt from in this folder

enter image description here

step 4- type " adb disconnect " command in Command prompt

enter image description here

step 5- restart android studio

Upvotes: 5

Arthur
Arthur

Reputation: 9

I spent a full day trying to solve this issue. Finally, I located and deleted my SDK folder then downloaded new SDK platforms and tools via SDK TOOLS. Everything is working fine now.

Upvotes: -1

Gabriel Gava
Gabriel Gava

Reputation: 881

In my case, it was a faulty adb execution that was running in the background.

The only thing that worked for me was:

  • Close Android Studio
  • Kill adb process (on Task Manager on Windows)
  • Open Android Studio

Upvotes: 53

Ralph Maruva
Ralph Maruva

Reputation: 83

Kill the flutter processes from running first, taskkill /F /IM dart.exe in your terminal in android studio then type
flutter run. in the terminal again and press enter.

Afterwards your device you start showing.

Upvotes: 0

RayBacker
RayBacker

Reputation: 176

Check this

Project Structure->Project settings-> project->Project SDK setting

For me the project sdk was not set. After selecting the android sdk for the project, "loading devices" option is gone.

https://github.com/flutter/flutter-intellij/issues/5031#issuecomment-838640744

Upvotes: 0

Doan Bui
Doan Bui

Reputation: 4418

With New Android Studio and New Flutter, I try to Refresh a few times and it's working.

enter image description here

Upvotes: 1

MendelG
MendelG

Reputation: 20018

In your Terminal, run:

flutter upgrade

and restart Android Studio.

Upvotes: 0

Y.elinx
Y.elinx

Reputation: 411

In the path where Flutter is installed, delete the files "flutter.bat.lock" and "lockfile" and restart. enter image description here

Upvotes: 4

jashgopani
jashgopani

Reputation: 573

If you have stored your Flutter SDK in Local Disk C, then move it to another (Non-Admin Location) disk and then try using Android studio

Alternatively: Simply run your Android Studio as Administrator and it will work fine (Although running flutter with Admin privileges is not recommended nor required either)! I spent 3 hrs looking for a solution and suddenly realized this option and it worked for me

Upvotes: 30

Ashish
Ashish

Reputation: 637

Quick fix on Android Studio:

  1. Search anywhere -> (Shift+Shift )
  2. Look for -> Restart Flutter Daemon

enter image description here

Upvotes: 61

Biruk Telelew
Biruk Telelew

Reputation: 1193

Go to File -> Invalidate Caches / Restart... -> Invalidate and Restart worked for me.

Image of Android Studio

Upvotes: 38

Maxim Mazurok
Maxim Mazurok

Reputation: 4138

I was using another runtime, so I had to Ctrl+Shift+A -> Choose Runtime -> Default

Upvotes: 0

Khaled Developer
Khaled Developer

Reputation: 47

Solved For Me With:

  1. Update flutter Plugin

  2. File => Invalidate Caches / Restart => Invalidate and Restart

  3. Update Android Studio

  4. Update SDK

  5. Install SDK in Only default Location android Studio

  6. Tools => Troubleshoot Device Connection & read this and continue to Troubleshoot.

  7. Use (RunAsAdmin(Windows) / root USER(Linux)) FOR RUN

  8. if you use physical Device , use code IN TERMINAL LINUX {

sudo apt update
sudo apt install adb

and Check if your Device Connected

adb devices

}

Upvotes: 0

Benjamin James
Benjamin James

Reputation: 63

For me the issue seems to be that my anti-virus program identified dart.exe as a threat and renamed it to dart.exe.000 - what worked for me was -

  1. I downloaded the dart sdk and replaced the directory in my flutter directory 2) deleted flutter/bin/cache/flutter_tools.stamp 3) ran flutter doctor ...and then it worked

Upvotes: 0

Md Shariqq
Md Shariqq

Reputation: 1

Running Android Studio as Administrator (Windows) / Super User (Linux) fixed the issue for me.

Upvotes: -2

Roc Boronat
Roc Boronat

Reputation: 12151

On Windows, I fixed the issue by putting the Android SDK in the PATH. I guess the Flutter plugin internally uses ADB to know the attached devices, so if you don't have it in your path, nothing can be done.

If that's your case, just type adb on a terminal. If it doesn't work, it means you have to put your Android SDK in the path, so you (and the Flutter plugin) can use it.

Just adding a screenshot just to clarify it a bit.

enter image description here

Upvotes: 1

Tim Kariuki
Tim Kariuki

Reputation: 2030

This may happen if you have cloned an app and the Flutter and Dart paths have not been set. Delete the ".idea" folder and set the paths and if there are any connected devices, they will load automatically.

Upvotes: 0

Martin Gelevski
Martin Gelevski

Reputation: 101

The problem for me was that ADB was excluded from the Antivirus, so I've simply added an exception for the ADB and the problem was solved

Upvotes: 0

Shafqat Nadeem
Shafqat Nadeem

Reputation: 310

if nothing worked then try this : Download a new and stable version of Flutter SDK from here , point path of your flutter sdk from settings > search flutter > point path to new downloaded sdk > invalidate cache and restart. you are done !

Upvotes: 0

Eric Youn
Eric Youn

Reputation: 81

After hours of searching, this is what I found.

flutter doctor -v

I found that there were some SDK certificates that weren't agreed.

flutter doctor --android-licenses

Allowed me to see which agreements that weren't agreed. After that it worked. I hope this works for you.

Upvotes: 8

Related Questions