Error:Unable to locate adb within SDK in Android Studio

AngularAndroidAndroid StudioInstallationAdb

Angular Problem Overview


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.

Angular Solutions


Solution 1 - Angular

The ADB is now located in the Android SDK platform-tools.

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

enter image description here enter image description here enter image description here

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

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

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

enter image description here enter image description here

Hope this helps!

Solution 2 - Angular

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

Project Structure dialog

Solution 3 - Angular

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:

  1. Unistall Platform-Tools using Android Studio's SDK Manager
  2. Deleted all platform-tools\ directories within each C:\Users\<UserName>\AppData\Local\Android\sdk* directory
  3. Reinstalled Platform-Tools using Android Studio's SDK Manager

Hope this helps someone someday with their issue.

Solution 4 - Angular

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

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

Solution 6 - Angular

try this: File->project Structure into Project Structure Left > SDKs SDK location select Android SDK location (old version use Press +, add another sdk)

Solution 7 - Angular

Finally after several hours of investigation I think I have another solution for everyone having issues with AVD Manager "Unable to locate adb".

I know we have the setting for the SDK in File -> Settings -> Appearance & Behavior -> System Settings -> Android SDK. This it seems is not enough! It appears that Android Studio (at least the new version 4) does not give projects a default SDK, despite the above setting.

So, you also (for each project) need to go to File -> Project Structure -> Project Settings -> Project, and select the Project SDK, which is set to [No SDK] by default.

If there's nothing in the drop-down box, then select New, select Android SDK, and navigate to your Android SDK location (normally C:\Users[username]\AppData\Local\Android\Sdk on Windows). You will then be able to select the Android API xx Platform. You now should not get this annoying adb error.

HTH

Solution 8 - Angular

Just go your SDK Manager and install Android SDK Tools

Solution 9 - Angular

In my case it was a simple case of incorrect path. Simply went to Project Structure dialog (alt+ctrl+shift+s) and then to platform->SDK's and fixed Android SDK home path.

fix SDK path

Solution 10 - Angular

I deleted and re-installed the Android SDK Platform-Tools 23 23.0.0. This solved the problem. Yesterday i had done a complete update of the SDK using SDK Manager, deleting some parts that i believed i no longer needed and downloading updates. Perhaps this was the source of the problem.

Solution 11 - Angular

Got the same problem. MacOS, Android Studio 3.6.1, SDK Android 10.0.

This is the directory where Android studio is looking for adb binary:

$ cd ~/Library/Android/sdk/platform-tools/
➜  platform-tools $ ls
package.xml  platform-tools  signing_request_for.3232179dce22d8a6332018729026ed39f5d5cd0b.1585090071041.platform-tools_r29.0.6-darwin.filelist

However, the binary is in the one directory deeper:

➜  platform-tools $ ls platform-tools
adb  dmtracedump  etc1tool  hprof-conv  make_f2fs  mke2fs.conf  sload_f2fs         sqlite3
api  e2fsdroid    fastboot  lib64       mke2fs     NOTICE.txt   source.properties  systrace

Simply make a soft link to current directory:

➜  platform-tools $ ln -s platform-tools/adb ./
➜  platform-tools $ ls
adb          platform-tools
package.xml  signing_request_for.3232179dce22d8a6332018729026ed39f5d5cd0b.1585090071041.platform-tools_r29.0.6-darwin.filelist

This did trick for me.

P.S. Adding it to the PATH does not help, I can of course run it in terminal then, but Android Studio does not pick up PATH variable from .zshrc in MacOS.

Solution 12 - Angular

Detailed instructions with screenshots (works for M1 Mac and Windows 11)

Make sure you have the latest android studio from https://developer.android.com/studio (not from homebrew or some other source)

In android studio, open a project

  1. Install Android SDK Command-line Tools and Android SDK Platform-Tools

    Tools - SDK Manager

    enter image description here

  2. Select a project SDK

    File - Project Structure

    enter image description here

  3. Add the platform-tools and cmdline-tools to your Classpath

    File - Project Structure

    enter image description here

Solution 13 - Angular

yeah I have same experience

The ADB is now located in the platform-tools directory.

  1. korsosa said Check your [sdk directory]/platform-tools directory, if it exists. If not, then open the SDK manager in the Android Studio (a button somewhere in the top menu, android logo with a down arrow), and download&install the Tools > Android SDK Platform-tools.

  2. If you have platform-tools, you have check adb.exe file. In my case, that file was broken, so download that platform-tools again

Solution 14 - Angular

If you already have Android SDK Platform Tool installed then go to File > Settings > System Settings > Android SDK > Launch Standalone SDK Manager.

There you will see in Tools Directory that Android SDK Platform-Tools is uninstalled. So deselect all and check that box and simply click on install button.

Solution 15 - Angular

In my case I have tried the above but seems like adb won't get installed so all what I had to do is copy adb.exe to the folder and worked ! I copied adb.exe and pasted on the following paths in my device:

C:\Users\Your-Device-username\AppData\Local\Android\sdk

C:\Users\Your-Device-username\AppData\Local\Android\sdk\platform-tools

Hope this helps somebody in need.

Solution 16 - Angular

While all these answer might have been correct in my scenario it didn't work. It all started when i uninstalled 2.* android studio version after getting 3.0rc1. But that screw up things and started getting this error. After that i did followed majority of these steps and none of them worked. While analyzing SDK directory i noticed that i have two platform tools folder. The .backup had adb.exe where as the other one didn't. I just copied the .backup files in the other platform-tool folder and it fixed my issue.

enter image description here

Solution 17 - Angular

I don't know probably is too late to answer to this question. But if someone is in my situation and struggling with this problem will useful.

Few antivirus programs detect adb.exe as a virus. You should take a look in the place where antivirus is putting your detected threats and restore it from there. For Avast Antivirus is inside of virus chest

Hope it will be useful for someone !

Solution 18 - Angular

If you have an antivirus (such as AVG), you can take the file out of quarantine.

https://i.stack.imgur.com/xtunZ.png" width="400" height="400">

Click Menu > Quarantine > Check box next to the adb.exe file > Arrow next to delete > Restore

But sometimes, the file will keep reappearing in the quarantine. The way to solve this is by clicking Restore and add exception, or by going to Menu > Setting > General > Exceptions > And adding something like this: C:\Users\Johndoe\AppData\Local\Android\Sdk\platform-tools\

Other antiviruses have similar equivalents of a "quarantine" that the APK file may be in.

Solution 19 - Angular

Open Task Manager and find service adb.exe after saw those service just end it, and run again

Solution 20 - Angular

even after downloading specific required file or everything, we could face file execution error.

a file execution fail could be due to following reasons:

  1. user permission/s (inheritance manhandled).
  2. corrupt file.
  3. file being accessed by another application at the same time.
  4. file being locked by anti-malware / anti-virus software.

strangely my antivirus detected adb, avd and jndispatch.dll files as unclean files and dumped them to its vault.

i had to restore them from AVG vault. configure AVG to ignore (add folder to exception list) folder of AndroidStudio and other required folder.

if you are without antivirus and still facing this problem, remember that windows 7 and above have inbuilt 'windows defender'. see whether this fellow is doing the same thing. put your folder in antivirus 'exclusion' list as the vendor is trusted world wide.

this same answer would go to 'https://stackoverflow.com/q/26355645/2173890';. i don't have enough reputation to answer this question there and there.

Solution 21 - Angular

I had this issue with Android Studio 3, the SDK manager somehow didn't include the full tools in platform-tools folder so I had to download it manually from:

https://developer.android.com/studio/releases/platform-tools.html

then extract it to my android/sdk/platform-tools/ folder

Solution 22 - Angular

You can download from terminal or cmd like this:

$sudo apt update 
$sudo apt install android-tools-adb android-tools-fastboot

//check version or test adb is running or not
$adb version

Solution 23 - Angular

I struggled with this for a while. Tried to install/uninstall various packages under the SDK Manager without success. I even deleted Android Studio and reinstall it, it did not help.

I am running Android Studio 3.3 on OS X 10.14.2. At the end I tried the following:

rm -rf Library/Android/sdk

This removed the whole sdk folder. You should run this command on your home directory in terminal. (it is the default location when you open it)

I then started Android Studio and it could not find the sdk. So it prompted me to download it. I downloaded a fresh SDK and everything was working normally.

It might be an overkill but it worked.

Solution 24 - Angular

My Android Studio version 3.6.1

After getting updated the latest version I have been facing this problem for few hours. My steps to solve this:

-> Updated sdk platform-tools [though it's not fetching my device yet]

-> Change the USB cable, then my 2 devices both are getting connected with Studio and run my app successfully.

I don't know this silly step might help anyone but U can have a look on that. I just share my experience, Thanks.

Solution 25 - Angular

For me I was switching to zsh as the default shell on your Mac. Switch back and restart fixed it.

Solution 26 - Angular

After trying all of the above (and more), I googled how to reset Android Studio, which eventually worked for this!

On MAC, delete this folder:

~/Library/Application Support/Google/AndroidStudio4.1

I then checked the adb in the terminal by running adb command, and it was showing up as it should.

terminal screenshot

When I ran my react-native project with yarn start and yarn android, it failed, but running it a second time worked.

Solution 27 - Angular

Search for adb.exe inside Sdk\platform-tools folder. Go to Android emulator Settings (three dots > settings), uncheck "Use detected ADB location" and point to adb.exe path.

Solution 28 - Angular

For me, just need to

  1. Disable and Enable Developer Options.
  2. Then Enable USB Debugging. No idea why it disabled by itself.

Solution 29 - Angular

> It worked for me in this way

open your android studio First, and go to SDK manager : enter image description here

and Copy your Android SDK location then open PowerShell on your windows and go to that folder like :

cd C:\Users\YOURUSERNAME\AppData\Local\Android\Sdk

then go to platform-tools folder:

cd platform-tools

and then start ADB like this:

.\adb.exe

you can also check if there is any adb.exe by ls or dir in windows command line

> if there isn't any platform tools you should first install it and then > paste it into that directory that I've mentioned earlier

you can download platform-tool(adb) from here: https://developer.android.com/studio/releases/platform-tools

Solution 30 - Angular

if you have adb problem go to tools->sdk manager -> install missed sdk tools

my problem was solved using these way

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSleepsOnNewspapersView Question on Stackoverflow
Solution 1 - AngularAkos KView Answer on Stackoverflow
Solution 2 - AngularArtem LuzhanovskyiView Answer on Stackoverflow
Solution 3 - AngularNickView Answer on Stackoverflow
Solution 4 - AngularHGambleView Answer on Stackoverflow
Solution 5 - AngularLucky RanaView Answer on Stackoverflow
Solution 6 - AngularVladislav KanView Answer on Stackoverflow
Solution 7 - AngularSadSack963View Answer on Stackoverflow
Solution 8 - AngularAnand JainView Answer on Stackoverflow
Solution 9 - AngularasafaddView Answer on Stackoverflow
Solution 10 - AngularMickView Answer on Stackoverflow
Solution 11 - AngularIvan ErmilovView Answer on Stackoverflow
Solution 12 - AngularKabir SarinView Answer on Stackoverflow
Solution 13 - AngularFelix ShinView Answer on Stackoverflow
Solution 14 - AngularAbdul Rahman MeerView Answer on Stackoverflow
Solution 15 - AngularFahad AlkamliView Answer on Stackoverflow
Solution 16 - AngularAkshayView Answer on Stackoverflow
Solution 17 - AngularclauubView Answer on Stackoverflow
Solution 18 - AngularElijah MockView Answer on Stackoverflow
Solution 19 - AngulartesoView Answer on Stackoverflow
Solution 20 - Angularsifr_dot_inView Answer on Stackoverflow
Solution 21 - AngularDesolatorView Answer on Stackoverflow
Solution 22 - AngularHandyPawanView Answer on Stackoverflow
Solution 23 - AngularzirinispView Answer on Stackoverflow
Solution 24 - AngularMimu Saha TishanView Answer on Stackoverflow
Solution 25 - AngularHai nguyen thanhView Answer on Stackoverflow
Solution 26 - AngularverunarView Answer on Stackoverflow
Solution 27 - AngularAndreas AdelinoView Answer on Stackoverflow
Solution 28 - AngularGeneCodeView Answer on Stackoverflow
Solution 29 - Angularweb developerView Answer on Stackoverflow
Solution 30 - AngularS HemaNandhiniView Answer on Stackoverflow