2

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.

Don Kalonji
  • 165
  • 3
  • 13
  • what's the output of ```flutter doctor```? Are you sure flutter is fully installed on your computer? – Xoltawn Feb 27 '21 at 08:55

8 Answers8

3

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

Sagmar
  • 74
  • 1
  • 3
  • 16
2

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.

Don Kalonji
  • 165
  • 3
  • 13
  • I started from step 6 running `adb devices` in console and it starts working. So in my case the problem was that adb won't start automatically – wrozwad Feb 10 '22 at 08:44
1

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

0

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").

Don Kalonji
  • 165
  • 3
  • 13
0

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.
Radhey
  • 2,139
  • 2
  • 24
  • 42
0

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 ...

vdaika
  • 1
0

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

0

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.

Saad Mansoor
  • 199
  • 7
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/33004151) – Prashant Oct 28 '22 at 07:57