Don Kalonji
Don Kalonji

Reputation: 215

Loading Devices Greyed out (Android Studio) Testing An App on a physical Device

I am very new to Flutter, my issue is as follows:

After enabling USB debugging on my android phone and establishing a connection with my PC in order to deploy a simple app on a physical device, when I needed to select my phone in Android studio, I noticed that "Loading Devices" is greyed out.

How can I fix this? I need to select my phone in Android studio.

Upvotes: 5

Views: 9306

Answers (11)

Pankaj Badgujar
Pankaj Badgujar

Reputation: 81

I tried updating Android SDK platform tools, deleting them and reinstalling them, all of which did not help me. What worked was I ran ps aux | grep adb to see what adb processes were running, and then killall adb

This helped clear the "Loading devices" message and my emulator started appearing there.

Note: verified and valid on linux Ubuntu 20.04

Upvotes: 3

Arash Torkaman
Arash Torkaman

Reputation: 67

i had same issue . in my case in Run/Debug configuration ( the spinner right next to select device) i select "app" and then select device became enabled .

Upvotes: 0

mostafa montaser
mostafa montaser

Reputation: 21

In 3.3 or above make sure to select this option in Settings->Debugger

enter image description here

Upvotes: 0

Saad Mansoor
Saad Mansoor

Reputation: 365

this might be un conventional answer, but it worked.

=> restart your PC and Android phone => make a new Flutter/Android Project. (to see if devices can connect to that)

I followed step 1,2 and 4 of @Don Kalonji's answer. then, i could run adb command in Windoes Command Prompt, but i could not run it inside Android Studio's terminal.

But after restarting both, computr and my phone, it started working.

Upvotes: 0

Sagir SGR
Sagir SGR

Reputation: 98

Update SDK Platform Tools Select Tools --> SDK Manager --> SDK Tools --> Select Android SDK Platform Tools Apply proceed!

Upvotes: 3

Simon Peter Ojok
Simon Peter Ojok

Reputation: 166

For macbook just update environment variable in .zshrc or .profile like that

export ANDROID_HOME=$HOME/Library/Android/sdk
export PATH=$PATH:$ANDROID_HOME/emulator
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/tools/bin
export PATH=$PATH:$ANDROID_HOME/platform-tools

then restarted android studio

Upvotes: 0

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 manager everything is working fine now

Upvotes: 1

vdaika
vdaika

Reputation: 1

This is my solution for this error: Right click to project -> Open Module Settings -> chose Project Setting, project and then select correct SDK. Hope it is helpful ...

Upvotes: 0

Radhey
Radhey

Reputation: 2239

Just create new project File -> New -> New Project and let it be configured by Android Studio. Have some patience if it is taking time and in the meantime allow/download suggested plugin if any updates prompt by Android Studio at bottom right side.

  • one possible root cause is you have the project in which your target sdk is lower not latest one and you are trying to upgrade your android studio.

Upvotes: 0

Don Kalonji
Don Kalonji

Reputation: 215

I suppose you meant step 4. In that case, after clicking on "new", when the prompt pops up, you have to create a new path to the adb folder you created in the C: drive (refer to step 3). Variable name: "path". Variable path: must be the path to the adb directory ("c:\adb").

Upvotes: 0

Don Kalonji
Don Kalonji

Reputation: 215

After trying a lot of suggested solutions here, which did not individually work for me, this is how I managed to solve the issue:

1 - I downloaded the ADB Package "SDK Platform-Tools for Windows" from https://developer.android.com/studio/releases/platform-tools

2 - Then, I unzipped the package in the root of my C: drive inside a new folder as follows C:\adb

  1. After, I copied the "adb" file from it and pasted it inside my Android SDK tools folder( C:\Users\Martflip\AppData\Local\Android\Sdk\tools)

4- I then set a new PATH for the adb folder in the System Environment Variables as follows: "C:\adb". To do so: On windows 10, In the taskbar search area, type "env" and select "Edit The system Environment Variables". Then click on "Environment Variables", then right under "User Variables", click on the "New" button to create a new path C:\adb.

5 - After creating the new path, I opened CMD as admin, and typed "cd c:\adb" and pressed enter. Make sure you unzipped the package in the adb folder you created in your c: drive before typing this! After that I then typed "adb" and pressed enter.

6 - After enabling USB debugging in Developer options on my Android phone and connecting my phone to my PC with a usb cable, I then typed "adb devices" and pressed enter in CMD. My phone was then listed. (make sure you a genuine usb cable, preferably the one that came with your phone).

7 - I went back to Android studio, and my phone could then selected and I was able to test my app on my Android phone.

Upvotes: 2

Related Questions