Search code examples
androidandroid-studioadb

How can I solve the "unable to locate adb problem" other than checking sdk path and uninstalling avast


I am trying to run my android project and there a "unable to locate adb" problem, anyone have any idea please?

My android sdk location is correct and I also uninstalled my avast antivirus application in case they are the reasons

enter image description here


Solution

  • 1- on your android studio go to Tools > android > SDK Manager.

    2- view android SDK location (this will show you your sdk path)

    3- navigate to file explorer on your system, and locate the file path, this should be found something like c://Users/xxxx/AppData/local/android (you can now see the sdk.)

    4- check the platform tools folder and see if you would see anything like adb.exe (it should be missing probably because it was corrupted and your antivirus or windows defender has quarantined it)

    5- delete the platform tools folder

    6- go back to android studio and from where you left off navigate to sdk tools (this should be right under android sdk location)

    7- uncheck android sdk platform-tools and select ok. (this will uninstall the platform tools from your ide) wait till it is done and then your gradle will sync.

    8- after sync is complete, go back and check the box of android sdk platform-tools (this will install a fresh one with new adb.exe) wait till it is done and sync project and then you are good to go.

    I hope this saves someone some hours of pain.