20

Today, I clicked some update when I launch Android Stodio. I forgot what it is. Then, I run some code when there is a error "8:34 PM IllegalArgumentException: Unable to locate adb"

Then, I google for few hours and still cannot solve my problem. And I found that there is no "adb.exe" under my platform-tools folder.

Can someone help?

my os is Window 10. I have tried uninstall Android Studio and install it back. It doesn't help.

Edit 1: After I re-install the platform-tools, I get back the adb.exe.But, I run my program again, it does the "ADB initialization", my adb.exe file lose again.

richardrun
  • 253
  • 1
  • 2
  • 8
  • 1
    Possible duplicate of [Error:Unable to locate adb within SDK in Android Studio](http://stackoverflow.com/questions/27301960/errorunable-to-locate-adb-within-sdk-in-android-studio) – Ahmad Aghazadeh May 18 '17 at 03:43
  • I tried to uninstall and install the platform-tool. It doesn't work – richardrun May 18 '17 at 04:05

11 Answers11

36

I am writing the solution which worked for me:

  • go to SDK Platform Tools;
  • download SDK Platform-Tools for Windows;
  • extract zip file and copy to \AppData\Local\Android\sdk\platform-tools.
JorgeAmVF
  • 1,660
  • 3
  • 21
  • 32
rookieDeveloper
  • 2,459
  • 1
  • 22
  • 44
  • 1
    Works like charm. – Wijay Sharma Dec 29 '17 at 19:44
  • I replaced the folder platform-tools in \AppData\Local\Android\Sdk\platform-tools with the version you suggested and emulator now works properly. For some reason adb.exe was missing – themhz May 09 '18 at 02:47
  • If you do no see adb file in plateform-tools folder then you have to manually download the plateform-tools folder from above link and copy and paste to android sdk folder – Muhammad Irfan Aug 15 '18 at 11:57
  • I replaced the platform-tools in my sdk location and now everything is good.! – Reagan Ochora Dec 08 '18 at 10:30
  • 3
    This is a life savior +1 . Later I found my antivirus removed adb.exe – ARiF Mar 22 '19 at 06:27
  • That is not a solution because it does not fix the underlying issue: Android Studio and IntelliJ are supposed to have platform-tools listed as a dependency under some of those---or whatever replaced that dependency needs to be referenced by the error message. – Ryan Feb 17 '23 at 20:59
16

Had the same problem. Solution was that Avast deleted the adb.exe. Try adding the SDK folder to your antivirus whitelist.

SWDEV
  • 191
  • 2
  • 6
7

What worked for me (after having AS 2.x and AS 3.x installed and trying to get Canary 3.1 to work):

Sometimes during an update/trying to sideload a new version of Android Studio, the updater/patcher screws up. It might delete adb after saying it will stop and update it, it might be fastboot or aapt ... whatever.

What works for me is to delete the whole sdk/platform-tools folder, restart AS and get it to redownload the entire platform tools package.

Then start AS again and go to File->Invalidate caches/restart.

If you have been updating Java, you might also want to ensure your JAVA_HOME is correct and that your AS project has been set to the correct JDK (project settings).

MacD
  • 783
  • 7
  • 23
5

Yep, looks like LOTS of folks (way too many, shame on you, Google) have come up with a missing 'adb.exe' symptom. (In my case, I claim that it never got installed at all, during my Windows-10 bundled installation of Android Studio, version 3.1.2.)

Ok, here's my recommended solution (which I borrowed and modified slightly from this question): Android Studio SDK installer hangs indefinitely at Unzipping 'platform-tools/systrace/NOTICE'

The second(?) answer is essentially correct..."Dx Arout" boldly and correctly recommends:

(1) Delete platform-tools from this location C:\Users\AppData\Local\Android\Sdk

and he/she's got the right idea, to then launch Android Studio and try to get it to complain and offer to fix the problem for you...says to:

(2) Then restart Android Studio. After gradle build finish it will ask for installation of missing tools. just click there. It should work fine.

Well, no, not quite. It didn't ask me anything, because I didn't get any errors from current proj's build. So, I had to 'kick-it-in-the-*ss', by launching Tools -> SDK Manager, choosing the middle tab ('SDK Tools'), and going to an already-installed entry named 'Android SDK Build-Tools 28-rc2' (your exact version entry may be somewhat different). So, click on its checkbox, choose 'Show package details' checkbox (down in lower-right corner). I lit up ALL the package variants, and forced it to install them all. That may have been overkill, but voila...once that completed, 'adb' DID get installed, as confirmed when I launched a debug run. (Down in the 'logcat' tab's log-message window, the two RED headings, finally turned to black and debugging was finally USEABLE!

Cheers...

David
  • 2,253
  • 5
  • 23
  • 29
3

it's easy just go to your sdk location like C:\Users\User\AppData\Local\Android\Sdk

there was to folder namely platform-tools and platform-tools.backup. open platfrm-tools.backup and copy the adb.exe and paste it to plaform-tools folder and now open the android studio again.studio will run smoothly and without any error Thank you

  • Hi, welcome to Stack Overflow. When answering a question that already has many answers, please be sure to add some additional insight into why the response you're providing is substantive and not simply echoing what's already been vetted by the original poster. – chb Mar 23 '19 at 05:57
3

I also faced the issue.

The avast antivirus had moved the file adb.exe to the virus chest and that was the cause of the issue. I have resolved it by restoring the adb.exe from the virus chest of avast.

2

Re-installing Android SDK Platform-Tools worked for me.

  1. Go to: Android Studio >> Tools >> SDK Manager >> Appearance & Behavior >> System Settings >> Android SDK >> SDK Tools
  2. Uncheck Android SDK Platform-Tools >> apply
  3. Check Android SDK Platform-Tools >> apply

enter image description here

1

The problem is solved. The issue I have is I upgraded the SDK platform-tools to 25.0.6. But My SDK Build-Tools is 25.0.3. (25.0.6 is not yet provided) I guess the version did not match which cause this problem.

I downgrade my SDK platform-tools to 25.0.3 and it is working as usual.

richardrun
  • 253
  • 1
  • 2
  • 8
1

adb.exe won't appear if antivirus is installed and we need to whitelist this. Anti virus block this because as it find .exe file so it will block it.

0

system deleted that file from platform tools u just make another copy of platform tools and whenever your system deleted your " adb.exe ". you can copy it to sdk/ platform .

this is a temporary solution i installed Quick Heal but its doesn't solve my problem

adb.exe is virus file for that its detected as malware

**

Solution 2 :

** Copy your SDK FOLDER in System folder where antivirus dont take action on it .

**

  • Solution 3: 1.Download new copy of Platform Tools

    2.paste it into SDK

    3.right click on adb.exe and go to security tab

    4.disable access of deleting by user system USERGROUP

Solution 4

copy sdk in appdata/local it will solve your problem permanent .

Thank You

kunal gharate
  • 53
  • 2
  • 11
0

no adb found. I had to delete the virtual device from AVD manager create another. now virtual device connected succesfully