50

unable to connect to adb.check the event log for a possible issue, verify that localhost entry is pointing to 127.0.0.1 or:: 1 for ipv4 or ipv6

enter image description here

Tried adb kill-server, restart, invalidate restart nothing works. Same issue reported over here https://issuetracker.google.com/issues/130791561

Note: I have not added any file or anything in studio, it's fresh installed Studio after format a full system still issue is there.

Zoe
  • 27,060
  • 21
  • 118
  • 148
MJM
  • 5,119
  • 5
  • 27
  • 53

17 Answers17

35

Replace your platform-tools with this one and delete the other one. https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip

Ved
  • 382
  • 2
  • 3
  • 5
    Your answer is not applicable for Mac or Linux users. – kostyabakay Jun 03 '19 at 15:48
  • 3
    **Restarting PC** is gonna be needed – S.R Jun 04 '19 at 14:08
  • 5
    Android SDK -> SDK Tools -> Remove "Android SDK Platform-Tools" and reinstall it. Restart PC should resolve this problem. Worked perfectly in Linux. – mustafiz012 Jun 19 '19 at 19:04
  • 1
    when i use only Genymotion i faced this error : unable to connect to adb.check the event log for a possible issue, verify that localhost entry is pointing to 127.0.0.1 or:: 1 for ipv4 or ipv6 .... this soulution worked for me . – SAYE Jul 08 '19 at 18:24
  • It's not a proper solution, I have solved the same issue by referring to this link https://stackoverflow.com/questions/56948774/not-able-to-connect-adb-android-studio-to-3-4-1/56948963#56948963 – Faiz Anwar Jul 09 '19 at 09:56
  • Downgrading platform-tool from higher version to 26 is not a perfect answer. anyway it solve the issue. – Adarsh Vijayan P Jul 13 '19 at 08:43
  • @abasnikzad For me the issue was starting Genymotion device before starting adb, I closed my Genymotion device and then first started adb after that running Genymotion device resolved this issue. Main Issue I feel here is that the port adb required to start was occupied by Genymotion so it can happen with other applications too like Skype – Umar Qureshi Sep 15 '19 at 13:56
23

I was also facing this issue in android Studio 3.4 version, but now I have fixed it , if you are using windows then follow these steps:

  1. Download Platform tools from here https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip

  2. Extract downloaded zip file

  3. Go To location "C:\Users\your_computer_user_name\AppData\Local\Android\Sdk" and Delete "Platform tools" folder

  4. Copy and Paste, downloaded platform tool folder to above location

  5. Now Go to your android studio and Rebuild your project Then run.

Seanny123
  • 8,776
  • 13
  • 68
  • 124
Basant
  • 741
  • 7
  • 16
11

For Mac Users, follow these simple steps :

  1. Just simply Navigate to Tools > SDK Manager> Android SDK>, then click on the Tab of SDK Tools, then look for Android SDK Platform-tools and update it.

  2. Then the last step, Invalidate cache and restart your IDE, after that, then finally you restart your Mac. (Sometimes it's this step is unnecessary)

It will work out successfully.

enter image description here

Lutaaya Huzaifah Idris
  • 3,596
  • 8
  • 38
  • 77
  • 1
    this worked for me on my mac. Upgrade and invalidate-restart IDE was good enough – Avi May 07 '20 at 03:53
5

Solution for Linux Users.

System info: Linux Mint Cinnamon 19.1 , Android Studio 3.4.1

Issue description: Problem with platform tools.

Solution: Remove the folder manually and update SDK tools through Android Studio.

Step 1: Go to your Android SDK installation folder. By default under your home directory. Choose platform-tools and simply delete. (/home//Android/SDK)

enter image description here

Step 2: Open Android Studio and go to SDK Tools. (File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK -> SDK Tools) By the moment you should be able to see Android SDK Platform Tools line unchecked.

enter image description here

Step 3: Put a check to install Platform Tools and press OK. Notice it'll relocate the folder to the directory where deleted.

enter image description here

Now that you re-installed the platform tools, restart the Android Studio and your deployment targets should show up.

enter image description here

If you don't install the platform tool back and ever try to build or run a project you'll get this IDE error. Just FYI :)

enter image description here

So that's all. Enjoy. Happy coding

Gulbala Salamov
  • 198
  • 3
  • 9
  • Hi Gulbala, My mobile device is not connecting to android studio through USB, I have checked with platform tools 26 and 29, but no luck, I am using windows 7PC. please help me on this. – Naveen Nov 06 '19 at 06:20
4

If you use Windows, you might have a corruption in api-ms-win-crt-runtime-l1-1-0.dll. Try to update it - you can get the update from Microsoft's website.

You should check it - path/to/sdk/platform-tools and try to run adb.exe

Rob
  • 26,989
  • 16
  • 82
  • 98
  • i have installed fresh windows issue is still present old and new windows,before it working fine after update to 3.4 it cause the issue. – MJM Apr 23 '19 at 06:16
2

When you update Sdk platform tools(which contains adb.exe) to release 28.0.2 and if you are using windows 8.1 then it needs few updates from windows.

As per SDK Platform tools release notes(https://developer.android.com/studio/releases/platform-tools):

Updated Windows requirements : The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package."

Windows update url: https://support.microsoft.com/en-ca/help/2999226/update-for-universal-c-runtime-in-windows

Prerequisite for Windows update url: https://www.microsoft.com/en-us/download/details.aspx?id=42327

Faced the exact same issue but after updating with prerequisite url first then the other url provided now it is working perfectly fine for me.

amit kumar
  • 53
  • 6
2

It worked for me by selecting -> Use libusb backend

It worked for me by selecting

enter image description here

yOshi
  • 820
  • 7
  • 12
2

This worked for me on Windows:

  1. Goto cmd write %temp% hit enter -> delete all data from there.

  2. Restart your Computer.

  3. Open Android Studio now, it will work.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Abhishek Kumar
  • 111
  • 1
  • 7
1
  1. Clear all cache memory (related to Android Studio)

  2. Restart ADB manually from Android Studio (first option)

Open Command prompt and got android sdk>platform-tools> adb kill-server

press enter

and again adb start-server

press enter

  1. Restart ADB manually form Android Stidio (second option)

go to your (SDK store path) sdk>platform-tools>adb

press enter

ex. D drive > sdk>platform-tools>adb

  1. Restart your system
1

Delete the platform-tools folder from the sdk and replacing with the same from your another pc. I am also facing this problem after updating to 3.4. If you face same problem please update to Android Studio 3.5 Canary Channel.

0

The reason is for ADB server problem. Simply re-run your adb.

(Go to your SDK folder then inside platform-tools folder you can see adb.exe. copy the path location and paste it in your computers system Environment variable. Set a new path there and paste the adb.exe file location there. hope it will solve )

0

If you are using Genymotion, there is an update that fix the problem.

Genymotion 3.0.2 (April 18th, 2019)

Corrections

We have fixed an incompatibility with the adb tool bundled in the platform-tools 28.0.2 package of the Android SDK, which caused failures to start virtual devices.

This new version of adb changed the behavior of the “adb connect :” command by making the “port” part mandatory. This broke Genymotion Desktop in a few places where it did not pass the port. We have adjusted the way we call “adb connect” and also updated the version we ship with the product to match the one in platform-tools 28.0.2.

Leonam Anjos
  • 181
  • 1
  • 8
0

If non of the above answers worked for you (as same happend to me), down grade to the old version of Android Studio by following these steps:

  1. Uninstall current Android Studio
  2. Go to Android Studio Archive and download any older version
  3. After installation, Open the project. You might see an error like this

This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.

  1. Now, open project gradle and update classpath tools.build version. I.e. in my case Android studio version is 3.2 and classpath 3.2.1

Hope it might save someone time.

isamirkhaan1
  • 749
  • 7
  • 19
0

I faced this issue last night, and I tried these methods to fix:

  • download older platform-tools and place it in the android sdk folder.(not work for me)
  • adb kill-server, adb start-server.(not work for me, adb had no response with these cmd)
  • kill the process that occupies port 5037.(for me, there is no other .exe run at this port)
  • reinstall platform-tools in Android Studio.(not work)
  • download ADB Kits and replace them in platform-tools folder.(work!!!)

It seems that my adb file has been modified or replaced by some programs. You can try these methods, and I hope some of them can work for you.

东方魔盗
  • 774
  • 1
  • 5
  • 5
0

I had this issue only after a Genymotion update, on Mac.

What worked for me: Open Genymotion preferences, Select ADB, choose "Use custom Android SDK tools" and points to your Android SDK folder.

Jérémy Reynaud
  • 3,020
  • 1
  • 24
  • 36
0

Actually the problem is not with the android studio version 3.4 Problem is with the android platform tools version which is latest one 29.

So install the previous version of the android platform tools version it will solve your problem. as above @Ved mentioned.

Ved link: https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip

Ejaz Ahmad
  • 614
  • 5
  • 12
0

EndTask adb.exe from Background processes (TaskManager) and Run Application again. It works for me

Fakhar
  • 3,946
  • 39
  • 35