无法打开调试器端口:java.net.SocketException "Socket closed" [英] Unable to open debugger port : java.net.SocketException "Socket closed"

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

问题描述

尝试在 Android Studio (v.0.4.4) 上调试 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"

app 编译通过,可以使用 adb 推送到手机上.adb没有问题;我可以完美地安装/监控 logcat 等.我可以加载另一个项目并且可以很好地调试它.我切换回这个,它仍然坏了.所以这似乎排除了电脑(实际上是在 Windows 下运行的 Linux 虚拟机)、Android Studio 安装等的问题.我已经重新启动了这个虚拟机和主机电脑.

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.

去年我遇到了这个问题,然后我通过卸载 Eclipse 来修复它"(我怀疑它可能试图获得相同的套接字).

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.

问题发生在我制作签名的、受保护的发布版本的时候.在那之前,我只运行了调试版本.但是,我相信我为创建此发布版本所做的只是编辑 build.gradle 并配置 Android Studio 以自动签署 apk.我已经恢复了对 build.gradle 的更改,但问题仍然存在.

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.

我在任何 Android Studio 日志文件中都没有看到相关错误;就好像这个异常正在被捕获,在屏幕上报告但没有记录在任何地方.

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.

推荐答案

在 Android Studio 桌面上,单击选择运行/调试配置"按钮(带有 android 图标的一个),您应该能够选择正确的选项.

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;Socket closed&quot;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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