问题
I am currently having this problem when I am opening a project:
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
回答1:
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.
回答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.
回答3:
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
来源:https://stackoverflow.com/questions/58795573/unable-to-create-debug-bridge-unable-to-start-adb-server-unable-to-detect-adb