简体   繁体   中英

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.

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.

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

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

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

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.

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

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

Can you please elaborate on step 3? You skipped the part where you make the path, there is a prompt for a variable name and a variable path.

Haha thanks I did mean step 4. I had the correct value (c:\adb) but I tried "adb" for path, that was wrong, thanks very much for this!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM