通过Android的工作室无法启动应用程序(logcat的[DEAD])应用程序、无法启动、工作室、Android

2023-09-05 07:26:36 作者:你甜到我心里啦

在过去两天的应用程序我的工作是显示为[DEAD]在logcat中,当我试图通过在Android的Studio中的运行按钮来启动应用程序一切似乎很好,除了应用程序不会开始和叶除了[DEAD]在Android的工作室,没有错误消息。任何想法,这是什么?

For the last two days the app I'm working on is showing up as [DEAD] in logcat and when I try to launch the app through the run button in Android Studio all seems fine, except the app never start and leaves no error message in Android Studio, except for [DEAD]. Any idea what this is?

更新: 我已经能够从logcat中删除[DEAD]的事情:

Update: I have been able to remove the [DEAD] thing from the logcat by:

从设备中删除该应用程序 重新启动设备(不应该,因为这是刚刚开始befor它发生,但以防万一) 无效缓存和重新启动在Android的工作室 在Android的工作室重新运行工具栏中的应用程序

这可能有助于让你再次去,但我的问题停留。

This might help to get you going again, but my question stays.

这是什么?

为什么会发生?

和最新解决它的正确方法是什么?

And whats the correct way of solving it?

推荐答案

上面的错误是由于

java.io.IOException异常

java.io.IOException

这将导致目前亚行的连接断开,并连接到另一个软件所生成的新的亚行的连接请求。

which causes the current adb-connection to disconnect and connect to the new adb-connection request made by another software .

java.io.IOException: An established connection was aborted by the software in your host machine

当您启动亚行客户端,客户端首先检查是否有已经运行的ADB服务器进程。如果没有,则它将启动服务器进程。当服务器启动时,它绑定到本地TCP端口5037和监听来自亚行发出的命令的客户端,所有的adb客户端使用的端口5037与亚洲开发银行服务器进行通信。

When you start an adb client, the client first checks whether there is an adb server process already running. If there isn't, it starts the server process. When the server starts, it binds to local TCP port 5037 and listens for commands sent from adb clients—all adb clients use port 5037 to communicate with the adb server.

然后,服务器建立连接,所有正在运行的模拟器/设备实例。它定位模拟器/设备实例通过扫描范围为5555奇数端口5585,所使用的仿真器/设备的范围内。当服务器发现了一个ADB守护程序,它建立到该端口的连接。 请注意,每个模拟器/设备实例将获得的一对连续的端口 - 。一个偶数端口控制台连接和奇数端口ADB连接

The server then sets up connections to all running emulator/device instances. It locates emulator/device instances by scanning odd-numbered ports in the range 5555 to 5585, the range used by emulators/devices. Where the server finds an adb daemon, it sets up a connection to that port. Note that each emulator/device instance acquires a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections.

以上信息也可以从它的文档中可以看出 http://developer.android.com/tool​​s/help/adb.html

Above information can also be seen from its documentation http://developer.android.com/tools/help/adb.html

在一个新的应用程序使用相同的连接,你的Andr​​oid应用程序的工作室在logcat中报道死亡。 要解决此问题,使用亚行杀-server命令

When a new application uses the same connection,your Android studio app reports DEAD in logcat. To resolve the issue,use the adb kill-server command

adb kill-server  //Terminates the adb server process.

,然后重新运行你的应用程序。

and then rerun your application.