Duroska Duroska - 1 year ago 269
Android Question

android studio 2.0 logcat spammed by deconnection


Android Studio
keeps being spammed by some sort of debug message ever since I upgraded to 2.0

[ 05-17 17:08:32.896 81: 81 D/ ]
Socket deconnection

[ 05-17 17:08:34.896 81: 81 D/ ]
Socket deconnection

[ 05-17 17:08:36.910 81: 81 D/ ]
Socket deconnection

[ 05-17 17:08:38.912 81: 81 D/ ]
Socket deconnection

[ 05-17 17:08:40.909 81: 81 D/ ]
Socket deconnection

[ 05-17 17:08:42.918 81: 81 D/ ]
Socket deconnection

and it keeps going and going.
It gets really spam happy whenever my app starts pushing data to a server. The data is making it across so I'm not sure whats happening.

I've added this to my logcat filter to try and get rid of it but it did not work: ^(?!WifiStateMachine|ConnectivityService|ConnectivityManager|dalvikvm|IInputConnectionWrapper)

Does anyone know how to get rid of this? its making it really hard to debug my app and keep track of my logs.

Thank you for your time

Thank you to a comment that pointed out that
can be pointed to the Android SDK and use THAT
which will stop this stupid spam
Under the genymotion main app, click options -> ADB -> custom android SDK
point to /AppData/Local/Android/sdk

Answer Source

Are you using Genymotion by chance? I had the same error after updating to version 2.7.0. By default, Genymotion uses its own adb.exe , located in the Genymotion\tools folder. I realized that three different instances of adb.exe are running at same time - one in Android\sdk\platform-tools folder and two in the Genymotion folder.

I changed the configuration of Genymotion to use the system adb.exe and the Socket deconnection error disappeared. I have Android Studio 2.1.2.

If you are using a real device, it might be a cable connection problem. In all cases, it is good to check if no different adb.exe instance is running simultaneously.

P.S. The Socket deconnection instant error appeared again, this time only on tablet AVD and only in landscape orientation. Should you experience the same, close all open applications and open Network and sharing center - change adapter settings. Right click on Virtualbox host only network - Properties, uncheck all other and leave only Virtualbox NDIS6 Driver, TCP/IPv4 and the two link - layers checked (I suspect the TCP/IPv6 was the cause). Then reboot the OS.

EDIT There is a second cause for the "socket deconnection" error. If it persists after changing the default ADB , exit Genymotion , wait a while , and open Virtualbox as standalone program. Choose your AVD - Settings - Network. If it is set to "Host only adapter" , change it to NAT Network - Name NatNetwork (NAT or Bridged might work too) . It seems that Genymotion forces the network adapter to "Host only" again at every startup and NAT is second adapter. Usually it works fine, but if the deconnection error occurs , the change to NAT Network makes it disappear.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download