将 Android Studio 升级到 3.4 后无法连接 adb

Not able to connect adb after upgrate Android Studio to 3.4

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

试过 adb kill-server,重启,无效重启都没有用。 此处报告了同样的问题 https://issuetracker.google.com/issues/130791561

注意:我没有在studio中添加任何文件或任何东西,它是格式化后全新安装的Studio,一个完整的系统仍然存在问题。

如果您使用 Windows,您的 api-ms-win-crt-runtime-l1-1-0.dll 可能会损坏。 尝试更新它 - 您可以从 Microsoft's website.

获取更新

你应该检查一下 - path/to/sdk/platform-tools 并尝试 运行 adb.exe

当您将 Sdk 平台工具(包含 adb.exe)更新到 28.0.2 版本时,如果您使用的是 windows 8.1,那么它需要 windows 的一些更新。

根据 SDK 平台工具发行说明(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 更新 url: https://support.microsoft.com/en-ca/help/2999226/update-for-universal-c-runtime-in-windows

Windows 更新的先决条件 url:https://www.microsoft.com/en-us/download/details.aspx?id=42327

面临完全相同的问题,但在先用先决条件 url 更新后,再更新另一个 url,现在它对我来说工作得很好。

  1. 清除所有缓存(与Android Studio相关)

  2. 从 Android Studio(第一个选项)手动重启 ADB

打开命令提示符并得到 android sdk>platform-tools> adb kill-server

按回车键

再次 adb start-server

按回车键

  1. 从 Android Stidio(第二个选项)手动重启 ADB

转到您的(SDK 存储路径)sdk>platform-tools>adb

按回车键

例如。 D盘 > sdk>platform-tools>adb

  1. 重新启动系统

用这个替换你的平台工具并删除另一个。 https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip

从 sdk 中删除 platform-tools 文件夹并替换为您另一台电脑上的相同文件夹。更新到3.4后我也面临这个问题。如果您遇到同样的问题,请更新到 Android Studio 3.5 Canary Channel。

我在 android Studio 3.4 版本中也遇到过这个问题,但现在我已经修复了它,如果您使用 windows 请按照以下步骤操作:

  1. 从这里下载平台工具 https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip

  2. 解压缩下载的 zip 文件

  3. 转到位置 "C:\Users\your_computer_user_name\AppData\Local\Android\Sdk" 并删除 "Platform tools" 文件夹

  4. 复制粘贴,下载平台工具文件夹到上面位置

  5. 现在去你的android工作室重建你的项目然后运行。

通过选择 -> 使用 libusb 后端

它对我有用

这对我有用 Windows:

  1. Goto cmd write %temp% hit enter -> 从那里删除所有数据。

  2. 重新启动计算机。

  3. 现在打开 Android Studio,它将运行。

原因是ADB服务器问题。只需 re-run 你的 adb.

(转到您的 SDK 文件夹,然后在 platform-tools 文件夹中您可以看到 adb.exe。复制路径位置并将其粘贴到计算机系统环境变量中。在那里设置一个新路径并粘贴adb.exe 文件位置在那里。希望能解决)

对于 Mac 用户,请按照以下简单步骤操作:

  1. 只需导航至 工具 > SDK 管理器> Android SDK>,然后单击 SDK 工具选项卡,然后寻找Android SDK Platform-tools并更新它。

  2. 然后最后一步,使缓存无效并重新启动您的 IDE,之后,最后您 restart 您的Mac。 (有时候这一步是不必要的)

会成功的

Linux 用户的解决方案。

系统信息: Linux Mint Cinnamon 19.1,Android Studio 3.4.1

问题描述:平台工具问题。

解决方法:手动删除文件夹,通过AndroidStudio更新SDK工具。

第 1 步: 转到 Android SDK 安装文件夹。默认情况下在您的主目录下。选择 platform-tools 并简单地删除。 (/home//Android/SDK)

步骤 2:打开 Android Studio 并转到 SDK 工具。 (文件 -> 设置 -> 外观和行为 -> 系统设置 -> Android SDK -> SDK 工具)此时你应该能够看到 Android SDK 平台工具行未选中。

步骤 3:勾选安装 Platform Tools,然后按确定。请注意,它会将文件夹重新定位到删除的目录。

现在您 re-installed 平台工具,重新启动 Android Studio,您的部署目标应该会出现。

如果您不重新安装平台工具并尝试构建或 运行 一个项目,您将收到此 IDE 错误。仅供参考:)

就是这样。享受。 快乐编码

如果您使用的是 Genymotion,则可以通过更新解决该问题。

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.

如果以上答案都不适合您(我也遇到过),请按照以下步骤将 Android Studio 降级到旧版本:

  1. 卸载当前 Android Studio
  2. 转到 Android Studio Archive 并下载任何旧版本
  3. 安装完成后,打开项目。您可能会看到这样的错误

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

  1. 现在,打开项目 gradle 并更新类路径 tools.build 版本。 IE。在我的例子中 Android 工作室版本是 3.2 和类路径 3.2.1

希望它可以节省一些人的时间。

我昨晚遇到了这个问题,我尝试了这些方法来解决:

  • 下载较旧的平台工具并将其放在 android sdk 文件夹中。(对我不起作用)
  • adb kill-serveradb start-server。(对我不起作用,adb 对这些命令没有响应)
  • 杀掉占用5037端口的进程。(对我来说,这个端口没有其他.exe运行)
  • 在 Android Studio 中重新安装平台工具。(不起作用)
  • 下载 ADB Kits 并在 platform-tools 文件夹中替换它们。(工作!!!

我的adb文件似乎被某些程序修改或替换了。这些方法你可以试试,希望其中的一些方法对你有用。

我在 Mac 上的 Genymotion 更新后才遇到这个问题。

对我有用的方法:打开 Genymotion 首选项,Select ADB,选择 "Use custom Android SDK tools" 并指向您的 Android SDK 文件夹。

实际上问题不在于 android studio 3.4 版 问题出在最新的 android 平台工具版本 29.

所以安装以前版本的android平台工具版本就可以解决你的问题了。如上所述@Ved提到。

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

EndTask adb.exe 来自后台进程 (TaskManager) 和 运行 应用程序。 对我有用