I get this error when trying to debug an Android app on Android Studio (v.0.4.4):
Error running <appname> [assembleDebug]:
Unable to open debugger port : java.net.SocketException "Socket closed"
The app compiles, and can be pushed to the phone using adb. There's no problem with adb; I can install/monitor logcat etc perfectly. I can load another project and can debug it just fine. I switch back to this one and it's still broken. So that would appear to rule out a problem with the pc (actually a Linux vm running under windows), the Android Studio install etc. I've rebooted this vm and the host pc.
I had this problem last last year and I "fixed it" then by uninstalling Eclipse (I suspected perhaps it was trying to get the same socket).
I've spent some time Googling and attempting suggestions but they don't make any difference.
The problem occurred around the time that I produced a signed, proguarded release build. Until then I'd only been running the debug build. However, I believe all I did to create this release build was to edit build.gradle and configure Android Studio to automatically sign apks. I've since reverted the changes to build.gradle but the problem remains.
I see no relevant errors in any Android Studio log files; it's as if this exception is being captured, reported on screen but not logged anywhere.
Hopefully somebody reading this can suggest a few things here to change that I've overlooked.