Java E/art: 向调试器发送回复失败:管道损坏,但应用程序仍在运行

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/31436157/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-11 11:08:02  来源:igfitidea点击:

E/art﹕ Failed sending reply to debugger: Broken pipe, but application still runs

javaandroiddebuggingandroid-studiologcat

提问by Vitaly Romaniv

When I run my application many lines appear in the logcat but only one error:

当我运行我的应用程序时,logcat 中出现许多行,但只有一个错误:

E/art﹕ Failed sending reply to debugger: Broken pipe.

E/art: 向调试器发送回复失败:管道损坏

What does it mean? And how can I fix it?

这是什么意思?我该如何解决?

采纳答案by David Rawson

Explaining the error:

解释错误:

E/ART: Failed sending reply to debugger: Broken pipe.

What is E/ART?

什么是 E/ART?

ARTis the Android RunTime. This is the bytecode interpreter on your Android phone. The Esimply indicates the logging level of ERROR.

ARTndroid řŤIME。这是 Android 手机上的字节码解释器。在E仅仅表示的日志记录级别ERROR

What is "sending reply to debugger"?

什么是“向调试器发送回复”?

Debugging on the Android phone is done using the adb(Android Debugging Bridge). The adbprocess runs on your dev machine (your laptop or PC) and a daemon runs on the Android device (i.e., the emulator or handset).

Android 手机上的调试是使用adb(Android 调试桥)完成的。该adb进程在您的开发机器(您的笔记本电脑或 PC)上运行,而守护进程在 Android 设备(即模拟器或手机)上运行。

What is a broken pipe?

什么是断管?

Your dev machine and the Android device communicate like a client server and a broken pipemeans that the communication has become invalid. For instance, the client (the Android device) is trying to send a reply to the server (the adb process running on the dev machine) but the server has already closed the socket.

您的开发机器和 Android 设备像客户端服务器一样通信,管道损坏意味着通信无效。例如,客户端(Android 设备)试图向服务器(在开发机器上运行的 adb 进程)发送回复,但服务器已经关闭了套接字。

How to fix it

如何修复

First make sure your app is building correctly by performing a clean/rebuild.

首先通过执行清理/重建来确保您的应用程序正确构建。

Then if you are running your app using USB debugging on a real phone then you can often fix the problem by unplugging the USB cable and then plugging it back in to reestablish the client/server connection.

然后,如果您在真实手机上使用 USB 调试运行您的应用程序,那么您通常可以通过拔下 USB 电缆然后重新插入以重新建立客户端/服务器连接来解决问题。

If this doesn't work, you can disconnect the USB cable and (stop the emulator if necessary) and close Android Studio. This is often enough to stop the adbprocess. Then when you open Android Studio again it will restart and the connection will be reestablished.

如果这不起作用,您可以断开 USB 电缆并(必要时停止模拟器)并关闭 Android Studio。这通常足以停止该adb过程。然后当您再次打开 Android Studio 时,它将重新启动并重新建立连接。

If this doesn't work, you can try stopping the adb server manually using the instructions in this question. For instance, you can try opening command prompt or terminal and going to the sdk/platform-toolsdirectory and typing:

如果这不起作用,您可以尝试使用此问题中的说明手动停止 adb 服务器。例如,您可以尝试打开命令提示符或终端并转到sdk/platform-tools目录并键入:

adb kill-server
adb start-server

回答by Tabassum Latif

  1. Check the file name colors in res folder if name is color then replace with colors
  2. I think you need to move your color declaration out of strings.xml and put it inside of colors.xml
  1. 如果名称是颜色,请检查 res 文件夹中的文件名颜色,然后用颜色替换
  2. 我认为您需要将颜色声明从 strings.xml 中移出并将其放入 colors.xml

colors.xml

颜色文件

<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="myColor">#ccff00</color>
</resources>

回答by Nilabja

killing the "adb" process helped me recover from this error. Just try restarting the adb.

终止“adb”进程帮助我从这个错误中恢复过来。只需尝试重新启动 adb。

回答by Chandan kumar mourya

The Error comes because of not getting the actual data or class. Use Android Monitor with Log level Error and no Regex filter to check error. Hope you will get actual error.

错误是因为没有获得实际的数据或类。使用带有日志级别错误且没有正则表达式过滤器的 Android Monitor 来检查错误。希望你会得到实际的错误。

回答by Karim Fikani

You can do the following:

您可以执行以下操作:

  • Kill emulator and Android Studio
  • Open Android Studio and "Rebuild" that basically deletes the build folder and recreates it.
  • 杀死模拟器和 Android Studio
  • 打开 Android Studio 和“重建”,基本上删除构建文件夹并重新创建它。

回答by Warpzit

I had a breakpoint in a return statement, when I removed it everything ran as it should. So give that a try too (removing all breakpoints).

我在 return 语句中有一个断点,当我删除它时,一切都按原样运行。所以也试一试(删除所有断点)。

回答by Sam

I had this error when I made a mistake with a object type (img response) in my model class, while I tried to get response from my Url in Android. And when I fixed it the error gone

当我在模型类中使用对象类型(img 响应)出错时遇到此错误,而我尝试从 Android 中的 Url 获取响应。当我修复它时,错误消失了