Error:Unable to locate adb within SDK in Android Studio
Solution 1
The ADB
is now located in the Android SDK platform-tools.
- Check your
[sdk directory]/platform-tools
directory and if it does not exist, then open the SDK manager in the Android Studio (a button somewhere in the top menu, android logo with a down arrow), switch to SDK tools tab and and select/install the Android SDK Platform-tools.
- Alternatively, you can try the standalone SDK Manager: Open the SDK manager and you should see a "Launch Standalone SDK manager" link somewhere at the bottom of the settings window. Click and open the standalone SDK manager, then install/update the
"Tools > Android SDK platform tools".
If the above does not solve the problem, try reinstalling the tools: open the "Standalone SDK manager" and uninstall the Android SDK platform-tools, delete the
[your sdk directory]/platform-tools
directory completely and install it again using the SDK manager.Check your antivirus chest. Sometimes the Antivirus program thinks adb.exe is a virus. If you find it there please restore the file and it will start working. You can also put adb.exe as a safe file in you Antivirus program.
Hope this helps!
Solution 2
In my case I had no SDK selected for my project(not sure why). Simply went to Project Structure dialog (alt+ctrl+shift+s
or button 1 on the screen) and then to project-> Project SDK's was selected <no SDK>
. Just changed it to the latest
Solution 3
For anyone who is still running into this issue. I had a similar problem where I could see my device from adb on the command line using adb devices
but Android Studio would not recognize when I had a device attached and would throw either:
-
Unable to locate adb within SDK
or -
Unable to obtain result of 'adb version'
I had tried start/stops of adb, uninstalls, of platform-tools, and more. What I found was that inside my
C:\Users\<UserName>\AppData\Local\Android
folder I had multiple sdk folders. I performed the following:- Unistall Platform-Tools using Android Studio's SDK Manager
- Deleted all
platform-tools\
directories within eachC:\Users\<UserName>\AppData\Local\Android\sdk*
directory - Reinstalled Platform-Tools using Android Studio's SDK Manager
Hope this helps someone someday with their issue.
Solution 4
If you are using Android Studio and have AVG virus protection, the adb.exe file might be in the Virus Vault. This was my problem. To fix: Open AVG. Select Options (top right), then Virus Vault. If you see the adb.exe file in there, select it and then click Restore.
Solution 5
In Android Studio, Click on 'Tools' on the top tab bar of android studio
Tools >> Android >> SDK Manager >> Launch Standalone Sdk manager
there you can clearly see which platform tool is missing , then just install that and your adb will start working properly.
Fully install at-least one Api package (Android Api 23 or 24) .
Comments
-
SleepsOnNewspapers over 2 years
Does anyone know what this means? When I click the "run" button on my simulator I get this message.
Throwable: Unable to locate adb within SDK
I am running the latest version,
0.8.14
. -
SleepsOnNewspapers over 9 yearsso you think there's something wrong with my sdk location?
-
Vladislav Kan over 9 yearsYes, i think so. try to open sdk manager and also install all the plugins
-
IberoMedia almost 8 yearsC:\Users\myusername\AppData\Local\Android\sdk\platform-tools
-
SuperHaker about 7 yearsCan confirm this to happen in Avast.
-
Greg over 6 yearsI can't actually even see adb.exe in the separate SDK download (windows)?
-
Desolator over 6 years@Greg - you need to download platform-tools from the link above then place it in the above directory. restart your android studio and it should work
-
Greg over 6 yearsoh, ok so I'd downloaded the separate "sdk tools" not "platform tool" - thanks
-
Desolator over 6 years@Greg - sounds like it's a different issue
-
Greg over 6 yearsYep :) Not sure why Android Studio with Platform Tools selected/downloaded didn't have it, but got it now
-
M.ArslanKhan about 6 yearsyes, it also happens in Avast. Go to Protection>Virus chest> check the required checkbox adb.exe>click drop down on delete>restore>restart Android Studio
-
tobi512 about 4 yearsJust hit the same problem on CI-environment (Bitrise.io), thanks for pointing it out! Could be a recent change in v29.0.6 of the platform tools.
-
fikkatra almost 4 yearsIn my case I had only a single SDK folder, but uninstalling and re-installing Platform-Tools worked for me
-
EpicVoyage almost 4 yearsIn my case, I had not selected a project SDK. N00b mistake. This got me onto the right path. Thanks!
-
Aaron Elliot over 3 yearsThis fixed my issue for me! It was a flutter project.
-
Stacky over 3 yearsAs of Android Studio 4, you might also need to set an SDK for the project since the IDE does not seem to do this on its own.
-
Luc Bloom about 3 yearsI updated Android Studio (April 2021) and now there's a separate category called "Android SDK Command-line Tools". I installed those, restarted Android Studio and now it's working again.
-
Däñish Shärmà about 3 yearsnhi kaam kia bhai
-
Hesham Eraqi almost 3 yearsThis fixed the issue for me. Thank you.
-
anandhu over 2 yearsHEY FLUTTERORS... try this solution!
-
Shubhanu Sharma over 2 yearsWhere are Project SDK settings in Android studio 11? Couldn't find it.
-
ElSheikh over 2 yearsThanks a lot, this was a lifesaver, I tried on
Windows 11
and it is working fine the path forcmdline-tools
the path might be looking likeC:\Users\<USER-NAME>\AppData\Local\Android\Sdk\cmdlines-tool
-
Scott Deagan over 2 yearsPeople experiencing this issue should definitely check this first.