My AVD is of API 15, I don't know why but the following message keeps coming up whenever I run an application on emulator. It doesn't seem to have caused any trouble except for the error message in console.
我的AVD是API 15,我不知道为什么,但是每当我在模拟器上运行一个应用程序时,下面的消息就会不断出现。除了控制台中的错误消息外,它似乎没有造成任何麻烦。
[2012-06-17 00:03:26 - ddmlib] Broken pipe
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:122)
at sun.nio.ch.IOUtil.write(IOUtil.java:93)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:352)
at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.java:575)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:348)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:421)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:837)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:805)
at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:765)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:652)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:44)
at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:580)
What could be the cause?
原因是什么?
13 个解决方案
#1
31
If someone uses both eclipse and android studio together, then this error will be thrown by eclipse. So even if you select the device through DDMS, its gonna throw this error.
如果有人同时使用eclipse和android studio,那么这个错误将由eclipse抛出。所以即使你通过DDMS选择设备,它也会抛出这个错误。
#2
12
Old question, but still relevant and I didn't see any other answer with this information:
老问题,但仍然相关,我没有看到任何其他答案与这个信息:
For me it happened when another Eclipse was running at the same time, with DDMS competing over the same socket as the eclipse trying to connect to the Android device.
对我来说,这发生在另一个Eclipse同时运行时,DDMS与Eclipse试图连接Android设备的相同套接字竞争。
Solution was to close the other Eclipse. Hope it helps someone.
解决方案是关闭另一个Eclipse。希望它能帮助一些人。
Update: Probably a better solution is to edit the DDMS port of the other eclipse to something you don't use. So it's out of the race.
更新:可能更好的解决方案是将另一个eclipse的DDMS端口编辑为不使用的。所以这不是比赛。
#3
6
This happened to me when I had both monitor
and Eclipse ADT open. Try closing all Android related stuff and then do a adb kill-server && sleep 5 && adb devices
and then start your tool (Eclipse/Ant/AS) again.
这发生在我打开monitor和Eclipse ADT时。尝试关闭所有与Android相关的东西,然后做一个adb kill-server && && sleep 5 & adb设备,然后再次启动您的工具(Eclipse/Ant/AS)。
#4
5
'Broken pipe' means you have written data to a connection that had already been closed by the peer. Solution: don't. It is essentially an application protocol error.
“断开的管道”意味着您已经将数据写入了已被对等方关闭的连接。解决方案:不要。它本质上是一个应用程序协议错误。
#5
4
I guess that the client (Eclipse) communicate with the Server (your Emulator) by Pipe protocol (This protocol is well-know to communicate 2 process on the same machine).
我猜客户端(Eclipse)通过管道协议(管道协议)与服务器(您的仿真器)进行通信(该协议在同一台机器上通信两个进程是众所周知的)。
The communication channel can be broken sometimes. (There are possible 100+ reason for that)
有时通信信道是可以中断的。(可能有100个以上的原因)
To solve this issue: restart the emulator (AVD). Maybe you will have to wait a moment (~1min??) so Eclipse can restore the Pipe channel and your Log Cat will return. Otherwise, restart both Eclipse & the emulator to get rid of this error.
要解决这个问题:重新启动仿真器(AVD)。也许您需要等一会儿(~1min??),以便Eclipse可以恢复管道通道,您的日志猫将返回。否则,重新启动Eclipse和仿真器以消除此错误。
#6
2
The most common reason I've had for a "broken pipe" is that one machine (of a pair communicating via socket) has shut down its end of the socket before communication was complete. About half of those were because the program communicating on that socket had terminated.
我对“破裂管道”最常见的原因是,一台机器(一对通过插座进行通信的机器)在通信完成之前关闭了插座的一端。其中大约一半是因为在那个套接字上通信的程序终止了。
If the program sending bytes sends them out and immediately shuts down the socket or terminates itself, it is possible for the socket to cease functioning before the bytes have been transmitted and read.
如果发送字节的程序发送它们并立即关闭套接字或终止自身,套接字可能在字节被传输和读取之前停止工作。
Try putting pauses anywhere you are shutting down the socket and before you allow the program to terminate to see if that helps.
尝试在关闭套接字的任何地方设置暂停,然后在允许程序终止之前查看是否有帮助。
FYI: "pipe" and "socket" are terms that get used interchangeably sometimes.
提示:“管道”和“插座”是有时可以互换使用的术语。
#7
2
I noticed this happening frequently (every 5 mins or so) recently. The frequency seemed to increase if I had both a physical device and an emulator running.
我最近经常注意到这种情况(每5分钟左右)。如果同时运行物理设备和仿真器,频率似乎会增加。
Stopping the emulator and only using the physical device for debugging stopped it from happening as often - now I only see it once or twice a day.
停止模拟器,只使用物理设备进行调试,这样就不会经常发生这种情况——现在我每天只看到一两次。
To resolve it when it happens, you don't need to close down the emulator or reboot the device - turning USB Debugging Mode off and back on should make it show up again under adb.
要解决这个问题,您不需要关闭模拟器或重启设备——关闭USB调试模式,然后重新启动,这将使它在adb下再次出现。
#8
1
I have been struggling with this problem for a long time. Whenever I wanted to debug android mobile application with Chrome's debug tool I got disconnected every 5 mintutes.
我在这个问题上已经挣扎了很长时间。每当我想用Chrome的调试工具调试android移动应用程序时,我每隔5分钟就会断开连接。
I found out that the cause of this is indeed other process using connection to mobile phone that is running behind in OS that breaks the communication between mobile phone and OS.
我发现,造成这种情况的原因实际上是操作系统中运行的另一个使用手机连接的进程,它中断了手机和操作系统之间的通信。
I use Macbook Pro and I was running IntelliJ IDEA debugger + Android File Transfer (didn't knew this was running behind) and Chrome's debugger tool. When I closed Android File Transfer process with "Activity Monitor" tool everything was working well, no more disconnection between mobile phone and OS. My suggestion is to check always if you are running other Android process.
我使用Macbook Pro,我正在运行IntelliJ IDEA调试器+ Android文件传输(不知道这是在后面运行)和Chrome的调试工具。当我用“活动监控”工具关闭Android文件传输过程时,一切都运行良好,手机和操作系统之间没有更多的脱节。我的建议是,如果你正在运行其他的Android进程,要经常检查。
#9
0
I was using both Android Studio and DDMS. Closing DDMS fixed the problem for me.
我同时使用Android Studio和DDMS。关闭DDMS为我解决了这个问题。
Restarting Android Studio had no impact.
重启Android Studio没有任何影响。
#10
0
In case any one else did not find any solution to this. In eclipses Neon, this happened when i had two DDMS jars in the plugins directory. I had the andmore.ddms.jar and com.android_ddms.jar. Deleting one solves the error, i guess they both compete to connect to the same port.
如果其他人没有找到解决办法。在eclipses Neon中,这发生在我在plugins目录中有两个DDMS jar的时候。我有andmore.ddms。jar和com.android_ddms.jar。删除一个可以解决这个错误,我想他们都想连接到同一个端口。
#11
0
restarting the android device fixed my problem
重启android设备解决了我的问题
#12
-1
A "Broken pipe" exception occurs when a socket connection is closed by the client on the other side. Most of the time this is nothing to worry about.
当另一端的客户端关闭套接字连接时,会发生“破裂管道”异常。大多数时候,这没什么好担心的。
#13
-3
In my case, I remove the the .android in my home directory. That's Ok.
在我的示例中,我删除了主目录中的.android。没关系。
#1
31
If someone uses both eclipse and android studio together, then this error will be thrown by eclipse. So even if you select the device through DDMS, its gonna throw this error.
如果有人同时使用eclipse和android studio,那么这个错误将由eclipse抛出。所以即使你通过DDMS选择设备,它也会抛出这个错误。
#2
12
Old question, but still relevant and I didn't see any other answer with this information:
老问题,但仍然相关,我没有看到任何其他答案与这个信息:
For me it happened when another Eclipse was running at the same time, with DDMS competing over the same socket as the eclipse trying to connect to the Android device.
对我来说,这发生在另一个Eclipse同时运行时,DDMS与Eclipse试图连接Android设备的相同套接字竞争。
Solution was to close the other Eclipse. Hope it helps someone.
解决方案是关闭另一个Eclipse。希望它能帮助一些人。
Update: Probably a better solution is to edit the DDMS port of the other eclipse to something you don't use. So it's out of the race.
更新:可能更好的解决方案是将另一个eclipse的DDMS端口编辑为不使用的。所以这不是比赛。
#3
6
This happened to me when I had both monitor
and Eclipse ADT open. Try closing all Android related stuff and then do a adb kill-server && sleep 5 && adb devices
and then start your tool (Eclipse/Ant/AS) again.
这发生在我打开monitor和Eclipse ADT时。尝试关闭所有与Android相关的东西,然后做一个adb kill-server && && sleep 5 & adb设备,然后再次启动您的工具(Eclipse/Ant/AS)。
#4
5
'Broken pipe' means you have written data to a connection that had already been closed by the peer. Solution: don't. It is essentially an application protocol error.
“断开的管道”意味着您已经将数据写入了已被对等方关闭的连接。解决方案:不要。它本质上是一个应用程序协议错误。
#5
4
I guess that the client (Eclipse) communicate with the Server (your Emulator) by Pipe protocol (This protocol is well-know to communicate 2 process on the same machine).
我猜客户端(Eclipse)通过管道协议(管道协议)与服务器(您的仿真器)进行通信(该协议在同一台机器上通信两个进程是众所周知的)。
The communication channel can be broken sometimes. (There are possible 100+ reason for that)
有时通信信道是可以中断的。(可能有100个以上的原因)
To solve this issue: restart the emulator (AVD). Maybe you will have to wait a moment (~1min??) so Eclipse can restore the Pipe channel and your Log Cat will return. Otherwise, restart both Eclipse & the emulator to get rid of this error.
要解决这个问题:重新启动仿真器(AVD)。也许您需要等一会儿(~1min??),以便Eclipse可以恢复管道通道,您的日志猫将返回。否则,重新启动Eclipse和仿真器以消除此错误。
#6
2
The most common reason I've had for a "broken pipe" is that one machine (of a pair communicating via socket) has shut down its end of the socket before communication was complete. About half of those were because the program communicating on that socket had terminated.
我对“破裂管道”最常见的原因是,一台机器(一对通过插座进行通信的机器)在通信完成之前关闭了插座的一端。其中大约一半是因为在那个套接字上通信的程序终止了。
If the program sending bytes sends them out and immediately shuts down the socket or terminates itself, it is possible for the socket to cease functioning before the bytes have been transmitted and read.
如果发送字节的程序发送它们并立即关闭套接字或终止自身,套接字可能在字节被传输和读取之前停止工作。
Try putting pauses anywhere you are shutting down the socket and before you allow the program to terminate to see if that helps.
尝试在关闭套接字的任何地方设置暂停,然后在允许程序终止之前查看是否有帮助。
FYI: "pipe" and "socket" are terms that get used interchangeably sometimes.
提示:“管道”和“插座”是有时可以互换使用的术语。
#7
2
I noticed this happening frequently (every 5 mins or so) recently. The frequency seemed to increase if I had both a physical device and an emulator running.
我最近经常注意到这种情况(每5分钟左右)。如果同时运行物理设备和仿真器,频率似乎会增加。
Stopping the emulator and only using the physical device for debugging stopped it from happening as often - now I only see it once or twice a day.
停止模拟器,只使用物理设备进行调试,这样就不会经常发生这种情况——现在我每天只看到一两次。
To resolve it when it happens, you don't need to close down the emulator or reboot the device - turning USB Debugging Mode off and back on should make it show up again under adb.
要解决这个问题,您不需要关闭模拟器或重启设备——关闭USB调试模式,然后重新启动,这将使它在adb下再次出现。
#8
1
I have been struggling with this problem for a long time. Whenever I wanted to debug android mobile application with Chrome's debug tool I got disconnected every 5 mintutes.
我在这个问题上已经挣扎了很长时间。每当我想用Chrome的调试工具调试android移动应用程序时,我每隔5分钟就会断开连接。
I found out that the cause of this is indeed other process using connection to mobile phone that is running behind in OS that breaks the communication between mobile phone and OS.
我发现,造成这种情况的原因实际上是操作系统中运行的另一个使用手机连接的进程,它中断了手机和操作系统之间的通信。
I use Macbook Pro and I was running IntelliJ IDEA debugger + Android File Transfer (didn't knew this was running behind) and Chrome's debugger tool. When I closed Android File Transfer process with "Activity Monitor" tool everything was working well, no more disconnection between mobile phone and OS. My suggestion is to check always if you are running other Android process.
我使用Macbook Pro,我正在运行IntelliJ IDEA调试器+ Android文件传输(不知道这是在后面运行)和Chrome的调试工具。当我用“活动监控”工具关闭Android文件传输过程时,一切都运行良好,手机和操作系统之间没有更多的脱节。我的建议是,如果你正在运行其他的Android进程,要经常检查。
#9
0
I was using both Android Studio and DDMS. Closing DDMS fixed the problem for me.
我同时使用Android Studio和DDMS。关闭DDMS为我解决了这个问题。
Restarting Android Studio had no impact.
重启Android Studio没有任何影响。
#10
0
In case any one else did not find any solution to this. In eclipses Neon, this happened when i had two DDMS jars in the plugins directory. I had the andmore.ddms.jar and com.android_ddms.jar. Deleting one solves the error, i guess they both compete to connect to the same port.
如果其他人没有找到解决办法。在eclipses Neon中,这发生在我在plugins目录中有两个DDMS jar的时候。我有andmore.ddms。jar和com.android_ddms.jar。删除一个可以解决这个错误,我想他们都想连接到同一个端口。
#11
0
restarting the android device fixed my problem
重启android设备解决了我的问题
#12
-1
A "Broken pipe" exception occurs when a socket connection is closed by the client on the other side. Most of the time this is nothing to worry about.
当另一端的客户端关闭套接字连接时,会发生“破裂管道”异常。大多数时候,这没什么好担心的。
#13
-3
In my case, I remove the the .android in my home directory. That's Ok.
在我的示例中,我删除了主目录中的.android。没关系。