[android] Error:Unable to locate adb within SDK in Android Studio

Does anyone know what this means? I'm kind of noobish to Android. 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.

EDIT: I'm using Android Studio

This question is related to android android-studio installation adb

The answer is


It will be happen when

not enough space

available for adb to start emulator.

Just free some space (6 GB) in SDK parent directory.

If Dose not work so go and test other ways that mentioned here.


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 'Error in launching AVD with AMD processor'. i don't have enough reputation to answer this question there and there.


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.


I get the error message, but adb.exe runs anyway (and debugging works fine), so its not a problem (apart from the error message being annoying). My best guess is that more than one process is trying to start the program at the same time.


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.


I know this is silly, but in my case while I was getting the same error message, just changing the USB cable used to connect the device fixed the problem :O

Perhaps this might benefit someone else as well?!


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.


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.


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


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


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

my problem was solved using these way


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.


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.


Just go your SDK Manager and install Android SDK Tools


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


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

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.


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.


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


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


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


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

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


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 !


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


If you are running windows 10 ( may be windows 7 as well ) and Android studio, Chances are that it could be because of windows virtual memory problem. See this unable to get adb version


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.


It's worked for me (Android Studio 3.1.3):

1. Make sure that 'Android SDK Platform-Tools' is installed:

Tools > SDK Manager > SDK Tools (Tab)

2. Copy path of 'adb.exe' file. Usually here:

C:\Users\Username\AppData\Local\Android\Sdk\platform-tools

3. Open Enviroment Variables in Windows:

'Window + R' > and type 'SystemPropertiesAdvanced'> Enviroment Variables...

4. Create new system variable with name 'PATH' and value of your adb.exe path like that 'C:\Users\Username\AppData\Local\Android\Sdk\platform-tools'


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


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


Examples related to android

Under what circumstances can I call findViewById with an Options Menu / Action Bar item? How to implement a simple scenario the OO way My eclipse won't open, i download the bundle pack it keeps saying error log getting " (1) no such column: _id10 " error java doesn't run if structure inside of onclick listener Cannot retrieve string(s) from preferences (settings) strange error in my Animation Drawable how to put image in a bundle and pass it to another activity FragmentActivity to Fragment A failure occurred while executing com.android.build.gradle.internal.tasks

Examples related to android-studio

A failure occurred while executing com.android.build.gradle.internal.tasks "Failed to install the following Android SDK packages as some licences have not been accepted" error Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer WARNING: API 'variant.getJavaCompile()' is obsolete and has been replaced with 'variant.getJavaCompileProvider()' Flutter plugin not installed error;. When running flutter doctor ADB.exe is obsolete and has serious performance problems Android design support library for API 28 (P) not working Flutter command not found How to find the path of Flutter SDK

Examples related to installation

You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory. (mac user) Conda version pip install -r requirements.txt --target ./lib How to avoid the "Windows Defender SmartScreen prevented an unrecognized app from starting warning" PackagesNotFoundError: The following packages are not available from current channels: Tensorflow import error: No module named 'tensorflow' Downgrade npm to an older version Create Setup/MSI installer in Visual Studio 2017 how to install tensorflow on anaconda python 3.6 Application Installation Failed in Android Studio How to install pip for Python 3.6 on Ubuntu 16.10?

Examples related to adb

ADB server version (36) doesn't match this client (39) {Not using Genymotion} ADB device list is empty "unable to locate adb" using Android Studio Run react-native on android emulator Solving "adb server version doesn't match this client" error Adb install failure: INSTALL_CANCELED_BY_USER Session 'app': Error Installing APK Where is adb.exe in windows 10 located? How to debug in Android Studio using adb over WiFi Set adb vendor keys