错误“与 adb 的连接已关闭,并且发生了严重错误。”
我花了几天时间尝试启动任何 Android 程序。即使“Hello World”也给我同样的错误:
“与 adb 的连接已关闭,并且发生了严重错误”。
我在 Windows XP 计算机上运行 Eclipse v3.5 (Galileo)、Google API 2.2.8。
我已经使用了我在网上可以找到的所有技巧:命令行“adb Kill-server”,DDMS“重置ADB”,我在Eclipse之前和之后启动了模拟器,并搜索了其他程序正在使用的端口。
这是怎么回事?是否存在 Eclipse、Java、ADB、模拟器以及其他可用版本的神奇组合?
I've spent days trying to launch any Android program. Even "Hello World" gives me the same error:
"The connection to adb is down, and a severe error has occurred".
I'm running Eclipse v3.5 (Galileo), Google APIs 2.2.8, on a Windows XP machine.
I've used all the tricks I can find on the web: the command line "adb kill-server", the DDMS "reset ADB", I started the emulator both before and after Eclipse, and searched for ports being used by other programs.
What is going on here? Is there a magic combination of versions of Eclipse, Java, ADB, emulator, and whatever else that works?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(30)
请尝试以下步骤:
adb Kill-server
(在发出这些命令之前应关闭 Eclipse )adb start-server
这种方式对我有用。
也重新启动手机!
Try the below steps:
adb kill-server
(Eclipse should be closed before issuing these commands)adb start-server
It worked for me this way.
Restart your phone as well!
使用:
这对我有用。
和:
Use:
This worked for me.
And:
打开 Windows 任务管理器,终止名为 adb.exe 的进程,然后重新启动程序。
Open up the Windows task manager, kill the process named adb.exe, and re-launch your program.
我意识到 Eclipse 中项目的文件夹已关闭。我扩展了目录并启动了项目。我知道这听起来像是“理所当然”。我在工作区中打开了 .java 文件,这足以让我认为该项目已打开。
I realized the folder of the project in Eclipse was closed. I expanded the directory and the project launched. I know this may sound like a "no-brainer". I had the .java files open on the workspace, and that was enough to make me think the project was open.
我使用 Eclipse Juno 进行了尝试,效果很好:
瞧!尝试运行您的应用程序。
更新:它还有助于从任务管理器中终止进程 adb.exe 并重新启动它。 adb.exe 可以在这里找到:Android\android-sdk\platform-tools。
祝你好运
I tried this using Eclipse Juno and it worked fine:
and voila! try running your application.
UPDATE: It also helps to kill the process adb.exe from the task manager and restart it. adb.exe can be found here: Android\android-sdk\platform-tools.
Good luck
更新您的 Eclipse Android 开发工具。这对我有用。
Update your Eclipse Android development tools. It worked for me.
确保它没有在任务管理器进程中运行。如果是这样,请结束该进程,然后从命令提示符启动它,如前面的答案所示。这对我有用。
Make sure it's not running in the task-manager processes. If so, end the process and then start it from a command prompt as in a previous answer. This worked for me.
在我的情况下:我有同样的警告:
与 adb 的连接已断开,并且发生了严重错误
我找到了解决方案:
adb.exe 已从:
android-sdk-windows\tools\adb.exe代码> 到
android-sdk-windows\platform-tool\adb.exe
。唯一的事情。将文件
adb.exe
移动到\tools
。并重新启动 Eclipse。In my situation: I have the same warning:
The connection to adb is down, and a severe error has occured
I have found the solution:
The adb.exe was moved from:
android-sdk-windows\tools\adb.exe
toandroid-sdk-windows\platform-tool\adb.exe
.Only thing. Move file
adb.exe
to\tools
. And restart Eclipse.我知道这个问题已经得到解答,但我想我可以补充一下,我发现问题出在我的
android-sdk
目录上的文件夹权限上。我通过授予每个人完全控制权来测试它(狡猾,我知道......),问题就消失了。我还不确定它正在寻找的具体权限组合是什么,但我假设 Eclipse 中的某些或其他服务没有 adb.exe 的执行权限。也就是说,我对此完全是个菜鸟——只是想把它放在那里,以防其他人对此有一些见解。
我正在运行 Windows 7、64 位、4.2.0 Eclipse 和 20.0.0v201206242043 ADT。
I know this question has already been answered, but thought I might add that I found the problem to be folder permissions on my
android-sdk
directory.I tested it out by granting Full Control to Everyone (dodgy, I know...), and the problem went away. I am not sure yet what the specific mix of permissions might be that it was looking for, but I assume some or other service in Eclipse didn't have execute permissions on adb.exe. That said, I'm a complete noob to this - just wanted to put it out there in case someone else had some insights into this.
I am running Windows 7, 64-bit, 4.2.0 Eclipse, and 20.0.0v201206242043 ADT.
转至具有 Android 备份文件的 Android 文件夹中可用的
cmd
文件夹平台工具中的文件夹platform-tools
。输入以下内容
和
然后输入
You can now see your device。
Go to the folder
platform-tools
incmd
folder platform tools available in the Android folder where you have Android backup files.Type the following
and
then type
You can now see your device.
这个问题困扰了我好几天,直到我终于弄清楚是什么原因造成的。情况变得如此糟糕,即使在尝试了上述所有建议后,我什至无法更新我的应用程序。
HTC Sync 还运行一个名为 adb.exe 的进程。 HTC Sync 是安装 HTC USB 驱动程序时可用的可选程序。我最近更新了 HTC 捆绑包的安装,并且之前显然没有安装 HTC Sync。在任务管理器中检查 adb.exe 的属性显示它属于 HTC Sync,而不是 Android。
当我从控制面板卸载 HTC Sync 后,问题就消失了! (它与 USB 驱动程序分开列出,以便可以保留。)我从未见过运行多个 adb.exe 实例。我很想知道人们是否必须从任务管理器中终止该进程,检查一下它是否确实是您要终止的 Android 进程?
请阅读用户评论(我也有 HTC Thunderbolt):
http://www.file.net/process/adb.exe.html
This problem has been plaguing me for days until I finally figured out what was causing it. It got so bad I couldn't even update my apps even after trying all the above suggestions.
HTC Sync also runs a process called adb.exe. HTC Sync is an optional program available when installing the HTC USB driver. I had recently updated my installation of the HTC bundle and apparently hadn't installed HTC Sync before. Checking properties on adb.exe in the Task Manager showed it to belong to HTC Sync, not Android.
As soon as I uninstalled HTC Sync from the control panel the problem disappeared! (It's listed separately from the USB driver so that can stay.) I never saw more than one instance of adb.exe running. I'm curious to know if people having to kill the process from Task Manager, check to see if it's actually the Android process you are killing?
Please read user comments (I too have a HTC Thunderbolt):
http://www.file.net/process/adb.exe.html
只需进入
任务管理器
(Windows 用户)并终止abd.exe
(它以某种方式保持活动状态)。之后启动
Eclipse
。错误
安装 Netbeans Android 插件后出现 情况。关闭 Netbeans 后,
abd.exe
进程仍然处于活动状态。当您想再次启动 Eclipse 时...您将收到错误消息。您必须手动终止
adb.exe
,然后启动Eclipse
。这对我有用。
Simply go in
Task Manager
(windows users) and kill theabd.exe
(it is remaining active somehow).After that start
Eclipse
.The error
happened after installing plugin for Android of Netbeans. After closing Netbeans the process
abd.exe
remained active. When you want to start againEclipse
... you will get the error.You have to manually kill the
adb.exe
and then startEclipse
.It worked for me.
我也遇到了同样的问题,结果发现我的防病毒程序(Comodo)对 adb.exe 进行了沙箱处理,这就是它不起作用的原因。我关闭了防病毒软件,效果很好。考虑一下。
I had the same problems, and it turned out that my antivirus program (Comodo) sandboxed the adb.exe, and that is why it didn't work. I closed the antivirus, and it worked just fine. Consider that.
我的问题是我的防火墙阻止 ADB 绑定到它想要的端口。
My problem was that my firewall was preventing ADB from binding to the port it wanted to.
我进入任务管理器时遇到了同样的问题
即可
I had the same problem
That's all
我正在运行 Eclipse Neon2。在 Mac OS 10.12.4 上,我最近将 Android SDK 升级到最新的“SDK 工具”(v 25.2.5)、“平台工具”(v 26) 和“构建工具”(v 26) 并移动后遇到了此问题我的 Android Studio 开发项目之一。
不幸的是,这里的许多答案都不适合我。
所做的工作是在不同的文件夹中创建 Android SDK 的单独副本,然后通过“首选项 --> Android”将 Eclipse 指向它。您必须使用旧版本的 SDK,如此 SO 答案中所示。
下载单独版本的 SDK 并将其放在与主 Android SDK 不同的文件夹中后,启动 SDK 管理器(通过
/tools/android
)并安装所需的“平台工具”、“构建工具”和 Android 版本。不过,这里有两件重要的事情需要注意:确保您不升级您的“SDK 工具”超出已安装的版本!
确保您安装的“构建工具”版本小于26!
否则您可能会遇到此问题< /a>.
I am running Eclipse Neon2. on Mac OS 10.12.4 and I experienced this issue after recently upgrading my Android SDK to the latest "SDK Tools" (v 25.2.5), "Platform tools" (v 26) and "Build Tools" (v 26) and moving one of my development projects to Android Studio.
Unfortunately none of the many answers here worked for me.
What did work was to create a separate copy of the Android SDK in a different folder and then point Eclipse to it via "Preferences --> Android". You will have to use an older version of the SDK as indicated in this SO answer.
Once you've downloaded the separate version of the SDK and put it in a different folder than your main Android SDK, launch the SDK Manager (via
<separate-sdk>/tools/android
) and install the required "Platform tools", "Build-tools" and Android versions. There are two important things to observe here though:Make sure that you do not upgrade your "SDK Tools" beyond the version that's already installed!
Make sure that you install a version of the "Build tools" that is less than 26!
Otherwise you may run into this issue.
emulator.exe -avd
。模拟器运行需要一些时间。emulator.exe -avd <your avd>
. It will take some time for the emulator to run.我有类似的问题。我发现还有另一个 adb.exe 正在运行,它是从 BirdieSync(Thunderbird 同步工具)启动的。我发现,Windows 正在运行另一个不兼容的 adb。 EXE文件。只需将鼠标光标放在进程上方(在 Process Explorer 中),您就会看到哪个 adb.exe 已启动。
我还必须终止 BirdieSync 进程,因为它再次启动了错误的 adb.exe。
然后我就可以启动正确的 adb.exe,并且运行良好。
I had a similar problem. I found out that there was another adb.exe running which was started from BirdieSync (Sync Tool for Thunderbird). I found out with Process Explorer from Sysinternals, that Windows was running another incompatible adb.exe. Just put the mouse cursor above the process (in Process Explorer), and you'll see which adb.exe is started.
I had to kill the BirdieSync process as well, because it started the wrong adb.exe again.
Then I could start the right adb.exe, and it worked fine.
杀死神秘运行的 abd.exe 成功了。这突如其来的拦路虎让我停顿了好久。我正在执行各种命令行操作,并从我的用户文件夹中删除了锁定图标,但是直到您简单建议在任务管理器的运行进程中查找 abd 并将其杀死之前,一切都不起作用。
我发现了另一个新手障碍的答案:当主 .java 文件以外的任何文件处于活动状态时,不要运行 Eclipse。例如,如果在 main.xml 文件处于活动状态时运行它,您将收到无用的错误消息,创建一个类似于 main.xml.out 的奇怪文件,并且它不会运行。
The killing of the mysteriously running abd.exe worked. This sudden roadblock stopped me for a long time. I was doing all sorts of command line stuff and removed the lock icon from my user folder, but nothing worked until your simple suggestion of looking for the abd in the running processes of the task manager and killing it.
Another newbie roadblock I discovered an answer to: don't run Eclipse when any file other than the main .java file is active. If you run it when, for example, the main.xml file is active, you will get unhelpful error messages, an odd file created like main.xml.out, and it wont run.
我发现 SDK 的路径(Preferences* → Android → SDK Location)是原因。我的 SDK 路径如下:
路径中的空格是问题所在。要使其正常工作,您必须将
Program Files (x86)
更改为Progra~2
完整的正确路径是
C:\Progra~2\Android\android -sdk
。现在应该可以了。
I found the path of the SDK (Preferences* → Android → SDK Location) was the cause. My SDK path was the following:
The spaces in the path is the problem. To get it to work, you must change
Program Files (x86)
toProgra~2
The complete right path is
C:\Progra~2\Android\android-sdk
.Now it should work.
以前的解决方案可能会起作用。我解决了这个问题,下载最新的ADT(Android开发工具)并覆盖SDK文件夹中的所有文件。
http://developer.android.com/sdk/index.html
覆盖后如果这样,Eclipse 可能会警告说没有找到 SDK 的路径,进入 Preferences 并将路径更改为另一个文件夹(C:),单击 Apply ,然后再次更改并设置SDK路径并再次单击应用。
The previous solutions will probably work. I solved it downloading the latest ADT (Android Developer Tools) and overwriting all files in the SDK folder.
http://developer.android.com/sdk/index.html
Once you overwrite it, Eclipse may give a warning saying that the path for SDK hasn't been found, go to Preferences and change the path to another folder (C:), click Apply, and then change it again and set the SDK path and click Apply again.
关闭 Eclipse
在终端中使用此命令:
运行 Eclipse。
Close Eclipse
Use this in the terminal:
Run Eclipse.
如果您使用的是 Genymotion 模拟器:
请确保用于 Genymotion 的 SDK 路径也与用于 Eclipse 的路径相同。
如果这两条路径不同,也会发生此错误。
If you are using the Genymotion emulator:
Make sure that the SDK path used for Genymotion is also the same path used for the Eclipse.
This error also occurs if those two paths are different.
我已经尝试了上述方法,通过任务管理器结束adb进程,但没有用。但是当我以管理员身份运行 adb.exe 文件时,它工作正常。
I've tried the above methods, end the adb process through task manager and all, it didn't work. But when I ran the adb.exe file as admin it worked fine.
这是我运行的用于重新启动 adb(Android 调试桥)服务器的脚本:
Here is a script I run to restart adb (Android Debug Bridge) server:
上次遇到这个问题,通过adb restart解决了。如果您尝试过
adb Kill-server
和adb start-server
但没有成功,您可能想尝试一下。当我再次遇到同样的问题时,我尝试了上述所有答案,但没有运气,这是最后一个尝试的选择。它确实很有魅力。转到Android SDK管理器>> 安装必要的软件包。
Last time I faced this problem, was solved with adb restart. If you have tried
adb kill-server
andadb start-server
with no luck you might want to try this. When again I faced the same issue I tried all the above answers, with no luck, and this was the last option to try. It did work like a charm.Goto Android SDK Manager >> Install the essential packages.
梅德内克是正确的(就我而言......)。文件已移动。
我什至找到了这个文件:
它解释了这个问题。
此文件中的建议:
包括“platform-tools/”目录。
maydenec is correct (in my case...). The file was moved.
I even found this file:
Which explained this issue.
Suggestions in this file:
include the "platform-tools/" directory.
它对我来说首先启动我的 AVD 模拟器(从 AVD 管理器),然后运行我的程序。这里提到的其他东西。
(但是重新启动 ADB 服务器不起作用。)
It worked for me to start my AVD emulator first (from the AVD manager), and then to run my program. The other stuff mentioned here.
(Restarting the ADB server didn't work though.)
Eclipse → 首选项 → Android → NDK
检查“NDK Location”路径是否设置正确,然后使用浏览按钮进行设置。
Eclipse → preferences → Android → NDK
Check the "NDK Location" path is set correctly, and use the browse button to set it.
AndroidSDK → 平台工具 → Kill 不起作用。
但重新启动电脑后,它就起作用了。
AndroidSDK → Platform Tools → Kill did not work.
But after restarting my computer, it worked.