Reputation: 1269
I'm trying to add a virtual phone to the device list, however, the device list is stuck on loading.
I use the default nexus 5 device on AVD:
I am on Windows 10 and trying to set up Flutter.
Upvotes: 64
Views: 113899
Reputation: 1645
Went from Intel to Apple Silicon mac, using migration assistant, need to reinstall the platform tools to update ADB.
Upvotes: 0
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
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
Reputation: 31
On October 15th, I had this issue.
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
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
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.
Upvotes: 1
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
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
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
step 3- open command prompt from in this folder
step 4- type " adb disconnect " command in Command prompt
step 5- restart android studio
Upvotes: 5
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
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:
Upvotes: 53
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
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
Reputation: 4418
With New Android Studio and New Flutter, I try to Refresh
a few times and it's working.
Upvotes: 1
Reputation: 20018
In your Terminal, run:
flutter upgrade
and restart Android Studio.
Upvotes: 0
Reputation: 411
In the path where Flutter is installed, delete the files "flutter.bat.lock" and "lockfile" and restart.
Upvotes: 4
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
Reputation: 637
Quick fix on Android Studio:
Upvotes: 61
Reputation: 1193
Go to File -> Invalidate Caches / Restart... -> Invalidate and Restart worked for me.
Upvotes: 38
Reputation: 4138
I was using another runtime, so I had to Ctrl+Shift+A -> Choose Runtime -> Default
Upvotes: 0
Reputation: 47
Solved For Me With:
Update flutter Plugin
File => Invalidate Caches / Restart => Invalidate and Restart
Update Android Studio
Update SDK
Install SDK in Only default Location android Studio
Tools => Troubleshoot Device Connection & read this and continue to Troubleshoot.
Use (RunAsAdmin(Windows) / root USER(Linux)) FOR RUN
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
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 -
Upvotes: 0
Reputation: 1
Running Android Studio as Administrator (Windows) / Super User (Linux) fixed the issue for me.
Upvotes: -2
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.
Upvotes: 1
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
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
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
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