无法创建调试桥:无法启动 adb 服务器:无法检测 adb 版本

Unable to create Debug Bridge: Unable to start adb server: Unable to detect adb version

我目前在打开项目时遇到这个问题:

事件日志中显示的错误:

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

事件日志中显示的错误:

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

对于这个问题我有 2 个可能的解决方案:

(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/)

如果它不起作用,唯一剩下的解决方案是 ::

(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.

(我首先尝试了第二个选项,它对我有用)

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

并将它们添加到 windows defender 设置中: 1.开启windows后卫 2.进入防火墙和网络保护 3. Select 允许应用程序通过防火墙并在其中添加 4 个文件夹。

希望答案对您有所帮助,顺便说一句,这是我在 Whosebug 上的第一个答案。

这个问题与您的 adb.exe 或 android 工作室无关。 而且您不需要重新安装 Studio 或重置 windows.

实际上,您的 Windows 正在停止 adb.exe 启动套接字服务器,因为某些防病毒或第三方应用程序以某种方式干扰了您的网络设置。

解决方法是:

您需要重置网络设置。

1) 运行 CMD 提示为管理员。

2) 输入命令"netsh winsock reset"

3) 如果需要重启电脑

现在,如果您打开工作室,将不会出现 adbhostserver 错误。

转到您电脑中的 'netsh' (C:\Windows\System32)

click to see screenshot

运行 以管理员身份,命令 window 将打开,然后键入 'winsock reset',现在重新启动您的 PC...,一切顺利

在 Windows 中为您的设备更改自动播放设置。