1

I am currently having this problem when I am opening a project:

Click To View Image

The errors showing in Event Log :

Unable to detect adb version, exit value: 0xc0000409, adb output: adb.exe F 11-11 09:55:06 17768 944 fdevent_poll.cpp:64] failed to create fdevent interrupt socketpair: Invalid argument

The errors showing in event Log:

Emulator: emulator: ERROR: AdbHostServer.cpp:93: Unable to connect to adb daemon on port: 5037

Shashanth
  • 4,995
  • 7
  • 41
  • 51
SHOONYA
  • 352
  • 3
  • 14
  • I think the `adb.exe` file is missing from `/sdk/platform-tools` directory. Can you check it once? Are you using any (Free) antivirus programs like Avast or AVG? If YES, disable it while testing your Android app code. – Shashanth Nov 11 '19 at 05:17
  • Yes, the platform- tools is there. – SHOONYA Nov 11 '19 at 07:15
  • To solve the problem I just uninstalled the whole application and all of its components and reinstalled it. But the problem is still there – SHOONYA Nov 11 '19 at 07:16
  • I said `adb.exe` file not `platform-tools` folder. Check for the EXE file in that folder. – Shashanth Nov 11 '19 at 07:24
  • yes the file adb.exe is there – SHOONYA Nov 11 '19 at 07:35
  • Did you try this [solution](https://stackoverflow.com/a/49345049/5180017)? – Shashanth Nov 11 '19 at 07:59
  • let me try them all – SHOONYA Nov 11 '19 at 08:03
  • I have exactly the same issue. I tried every possible solution I could find online. Uninstalled Android studio COMPLETELY. I only downloaded platform-tools from Android studio site, and when I run any adb commands, I get the first error. – VipiN Negi Nov 23 '19 at 06:10
  • @SHOONYA did you get the solution for this? – VipiN Negi Nov 24 '19 at 13:44
  • i also tried every possibilities but still having the same issues. also i was not yet installed any antivirus too. once i running adb command i got this message. `adb.exe F 11-25 08:25:14 4384 6404 fdevent_poll.cpp:64] failed to create fdevent interrupt socketpair: Invalid argument` – Dev.Barai Nov 25 '19 at 02:59
  • @VipiNNegi I have added the answer to the problem, check it out – SHOONYA Nov 25 '19 at 12:47
  • @Dev.Barai : I have added the answer to the problem, check it out – SHOONYA Nov 25 '19 at 12:47

4 Answers4

7

This problem is not with your adb.exe or android studio. And you don't need to reinstall Studio or reset windows.

Actually your Windows stopping adb.exe to start socket server because somehow some antivirus or third party app disturbed your network settings.

The solution is:

you need to reset the network settings.

1) Run CMD promt as administrator.

2) Type command "netsh winsock reset"

3) restart pc if needed

Now if you open studio there would be no adbhostserver error.

Parikshit Sharma
  • 307
  • 2
  • 14
  • I had tried the solution provided by you early but it didn't worked so I had no option left rather than reset my windows and reinstall Studio – SHOONYA Dec 18 '19 at 19:28
  • no problem,but this worked for me thats why i posted this so that someone can get benefit from this. – Parikshit Sharma Dec 18 '19 at 20:24
2

I got 2 possible solutions for this problem:

(1st) : Download Revo Uninstaller and uninstall Android Studio from it. Revo is a powerful tool which removes all the files of the selected software including program data cache files and and all remaining settings and repositories. After that reinstall Android Studio and select "do not import settings" during the installation.

Revo Installer Download Link :: (https://www.revouninstaller.com/revo-uninstaller-free-download/)

If it doesn't work the only remaining solution is ::

(2nd) : Go to Settings / Update and Security / Recovery / And reset your pc. Select the option keep my files and reset it. Don't worry about your other hard disk data it will only reset all the programs in your C drive and will also save all the files of documents, downloads, videos and images.

(I tried the second option first and it worked for me)

The problem occurred in the first place because antiviruses tend to delete temp files and android studio saves its emulator files in temp folder. To solve it just go to your antivirus settings and search for "add exclusion" option and add these 4 folders there:

(instead of rajhr open the folder with your user name)

1 .  C:\Users\rajhr\.android   
2 .  C:\Users\rajhr\.AndroidStudio3.5 

3 .  C:\Users\rajhr\AppData\Local\Android

4 .  C:\Users\rajhr\AppData\Local\Temp\AndroidEmulator

And also add them to windows defender Settings : 1. Open windows defender 2. Go to firewall and network protection 3. Select allow app through firewall and add the 4 folders there.

Hope the answer helps you btw this is my first StackOverflow answer.

SHOONYA
  • 352
  • 3
  • 14
0

go to 'netsh' in your pc (C:\Windows\System32)

click to see screenshot

run it as administrator ,a command window will open , then type 'winsock reset', now restart your PC....and you are good to go

0

Change Autoplay settings in Windows for your Device.

Evan
  • 1