21

Consistently receiving this error message on Android Studio to run app:

java.lang.IllegalArgumentException: Unable to locate adb

Attempted several troubleshooting options by downloading ADB, but the issue was not resolved. Thoughts?

3

5 Answers 5

72

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

4
  • 2
    The [No SDK] fixed it for me. Thank you!
    – N3sh
    Jan 8, 2021 at 10:09
  • I joined this community, just to give you an upvote :) May 22, 2021 at 11:51
  • @SmarthBansal Thank you :) It's a community worth joining. There are a lot of clever people here always willing to help out.
    – SadSack963
    May 23, 2021 at 15:19
  • Came from StackOverflow to here. Solved my problem. Thanks a lot man! May 17, 2022 at 12:44
3

I fixed this problem by installing SDK from SDK Manager in Andoid Studio.

screenshot

1

Update: On versions of macOS > 10.15.x (Catalina), the file to use is: ¨/.zshrc as Apple switched to ZSH as the default login-shell starting with 10.15.

---- Original Answer Follows + small adjustments for clarity ----

This worked for me, on my Mac.
Install platform-tools, and update your $PATH environment variable:

Using your text editor of choice:

nano ~/.zshrc    # ~/.bashrc for macOS < 10.15

Edit existing PATH or add the following:

export PATH="$PATH:[PLATFORM-TOOLS-PATH-HERE]"

Save the file and refresh Zsh's configuration:

source ~/.zshrc    # (~/.bashrc if macOS < 10.15) Or zsh -l to re-read login scripts

Hope this helps.

0

Sometimes In “C: \ Users \ User \ AppData \ Local \ Android \ SDK \ platform-tools” folder ADB.exe can be missing. One you can get from developer.Android.com/studio/releases/platform-tools just download “SDK Platform-Tool for Windows” and copy paste ADB.exe, ADBWinApi.dll, ADBWinUsbApi.dll. And then your apps will run perfectly.

0

If you are working on React native,please make sure you have installed these tools because I was missing them and it resolved my issue

Necessary tools for installations

For further detail visit React Native doc for installation

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .