无法打开调试端口:java.net.SocketException异常"插座关闭" [英] Unable to open debugger port : java.net.SocketException "Socket closed"

查看:1317
本文介绍了无法打开调试端口:java.net.SocketException异常"插座关闭"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图调试Android上的工作室(v.0.4.4)的Andr​​oid应用程序,当我得到这个错误

 错误运行<应用程序的名字> [assembleDebug]:
无法打开调试端口:java.net.SocketException异常关闭套接字

该应用程序编译,并可以使用亚行推送到手机上。有与亚行没有问题;我可以安装/监控等logcat中完美。我可以加载其他项目,可以调试它就好了。我切换回这一个,它仍然打破。这样就会出现与PC(实际上是一个Linux的虚拟机windows下运行),Android的工作室安装等。我已经重新启动该虚拟机与主机PC排除问题。

去年我去年有这个问题,我的固定它,然后通过卸载的Eclipse(我怀疑也许它正试图获得相同的插座)。

我花了一些时间谷歌搜索,并试图建议,但他们没有任何区别。

问题发生围绕我公司生产的签署,proguarded发布版本的时间。直到那时我只一直运行调试版本。不过,我相信我所做的创建这个发布版本是编辑的build.gradle和配置的Andr​​oid Studio来自动登录的apk。因为我已经恢复了变化的build.gradle但问题仍然存在。

我看任何Android Studio的日志文件中没有相关的错误;这是因为如果该异常被捕获,报告在屏幕上而不是在任何地方登陆。

希望有人读这可以在这里提出一些事情来改变,我已经忽略了。

解决方案

在Android的工作室的桌面,点击选择运行/调试配置按钮(一个与Android的图标),你应该能够选择正确的选项。

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.

解决方案

On Android Studio desktop, click on "Select Run/Debug Configuration" button (one with an android icon), you should be able to select the correct option.

这篇关于无法打开调试端口:java.net.SocketException异常&QUOT;插座关闭&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆