WhenI run a project in android studio, I get this error - I/O Error: Connection refused
当我在android studio中运行一个项目时,我得到了这个错误——I/O错误:连接拒绝。
The emulator starts fine but doesn't pull in/reflect my project
Device connected: emulator-5554
Device is online: emulator-5554
Target device: Nexus4 [emulator-5554]
Uploading file
local path: /Users/martinsjolte/AndroidStudioProjects/FirstAPP1/Firstapp1/build/apk/Firstapp1-debug-unaligned.apk
remote path: /data/local/tmp/dk.first.Firstapp1
Installing dk.first.Firstapp1
DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/dk.first.Firstapp1"
Device disconnected: emulator-5554
Launching application: dk.first.Firstapp1/dk.first.Firstapp1.MainActivity.
DEVICE SHELL COMMAND: am start -n "dk.first.Firstapp1/dk.first.Firstapp1.MainActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER
I/O Error: Connection refused
My platform is a mac osx ver.12.9.1
我的平台是mac osx ver.12.9.1。
5 个解决方案
#1
7
Ok, I don't know if i got "the" answer. but here is how I've solved the same issue on my environnement ( Windows 8/Android Studio, but same error with ADT or eclipse) :
好吧,我不知道我是否得到了答案。但是,我在我的环境中解决了同样的问题(Windows 8/Android Studio,但与ADT或eclipse相同的错误):
Context of my issues :
I've got an Asus PC, and with all the application suite installed by default. So I've found that one of this Asus app ( currently "Asus sync") was using adb and in fact, it was taking control of the emulator over my adb in the AndroidSDK directory.
我有一个Asus PC,以及默认安装的所有应用程序套件。所以我发现这个Asus应用程序(目前“Asus sync”)使用的是adb,事实上,它是在AndroidSDK目录中对我的adb的仿真器进行控制。
How to fix as a PC user :
Go to Task manager ( right click on task bar) , and look for "adb.exe" . Then right click on it and select "Open the directory". This will bring you to the responding adb. In my case it was Asus Sync, so I just had to unistall this software and everything works fine !
到任务管理器(右击任务栏),寻找“adb”。exe”。然后右击它并选择“打开目录”。这将为您带来相应的adb。在我的例子中,它是Asus Sync,所以我只需要使用unistall这个软件,一切都没问题!
How to fix as a Mac user :
Go to Activity Monitor (/Applications/Utilities/), and look for "adb". Then try to kill the process. Then look if it solve your "Connection refused" in Android studio/ADT or eclipse
去活动监视器(/应用程序/实用程序/),寻找“adb”。然后试着杀死这个过程。然后看看它是否能解决Android studio/ADT或eclipse中“拒绝连接”的问题。
If still not working you can try :
- Start a emulator ( with your AVD manager)
- 启动模拟器(使用AVD管理器)
- when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
- 完成加载后,打开DDMS面板(在android studio中:菜单工具> android >监控DDMS)
- Look if you see your current running android emulator ( listed on the Device panel)
- 查看当前运行的android模拟器(在设备面板上列出)
- See if this line is kind of "flashing" ( connect/disconnect).
- 看看这条线是否有点“闪烁”(连接/断开)。
- If so, you have probably a other adb instance running in conflict
- 如果是这样,您可能有另一个在冲突中运行的adb实例。
- If not, you can restart adb or reinstall your SDK
- 如果没有,您可以重新启动adb或重新安装您的SDK。
Hope this could help someone !
希望这能帮助到一个人!
#2
2
This issue occurs when Android Debug Bridge aka ADB is not responding to the request from Android Studio. I killed the process adb.exe and started it again. This solved my problem.
这一问题发生在Android调试桥卡亚行没有响应来自Android Studio的请求时。我杀了亚开行。exe又开始了。这解决了我的问题。
#3
2
If you are using a real device :
如果你使用的是真实设备:
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
只要重新连接你的设备,确保你的电缆是可行的,你安装了合适的驱动程序。
#4
0
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
我遇到了同样的问题,我的问题是重新启动android studio。希望,这对你也有帮助。
#5
0
For me the following worked(after I tried the above points mentioned by others):
对我来说,接下来的工作(在我尝试了别人提到的几点之后):
- I tried debugging/running anther application. It was okay. So this pointed me to the direction that the current application has some problem
- 我尝试调试/运行另一个应用程序。这是好的。这就指向了当前应用程序存在问题的方向。
- if (point 1 == true) {I uninstalled the application from my phone manually }
- 如果(point 1 == true){我从我的手机手动卸载应用程序}
Then re-make/rebuild the application and debug/run worked
然后重新生成/重新构建应用程序和调试/运行工作。
#1
7
Ok, I don't know if i got "the" answer. but here is how I've solved the same issue on my environnement ( Windows 8/Android Studio, but same error with ADT or eclipse) :
好吧,我不知道我是否得到了答案。但是,我在我的环境中解决了同样的问题(Windows 8/Android Studio,但与ADT或eclipse相同的错误):
Context of my issues :
I've got an Asus PC, and with all the application suite installed by default. So I've found that one of this Asus app ( currently "Asus sync") was using adb and in fact, it was taking control of the emulator over my adb in the AndroidSDK directory.
我有一个Asus PC,以及默认安装的所有应用程序套件。所以我发现这个Asus应用程序(目前“Asus sync”)使用的是adb,事实上,它是在AndroidSDK目录中对我的adb的仿真器进行控制。
How to fix as a PC user :
Go to Task manager ( right click on task bar) , and look for "adb.exe" . Then right click on it and select "Open the directory". This will bring you to the responding adb. In my case it was Asus Sync, so I just had to unistall this software and everything works fine !
到任务管理器(右击任务栏),寻找“adb”。exe”。然后右击它并选择“打开目录”。这将为您带来相应的adb。在我的例子中,它是Asus Sync,所以我只需要使用unistall这个软件,一切都没问题!
How to fix as a Mac user :
Go to Activity Monitor (/Applications/Utilities/), and look for "adb". Then try to kill the process. Then look if it solve your "Connection refused" in Android studio/ADT or eclipse
去活动监视器(/应用程序/实用程序/),寻找“adb”。然后试着杀死这个过程。然后看看它是否能解决Android studio/ADT或eclipse中“拒绝连接”的问题。
If still not working you can try :
- Start a emulator ( with your AVD manager)
- 启动模拟器(使用AVD管理器)
- when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
- 完成加载后,打开DDMS面板(在android studio中:菜单工具> android >监控DDMS)
- Look if you see your current running android emulator ( listed on the Device panel)
- 查看当前运行的android模拟器(在设备面板上列出)
- See if this line is kind of "flashing" ( connect/disconnect).
- 看看这条线是否有点“闪烁”(连接/断开)。
- If so, you have probably a other adb instance running in conflict
- 如果是这样,您可能有另一个在冲突中运行的adb实例。
- If not, you can restart adb or reinstall your SDK
- 如果没有,您可以重新启动adb或重新安装您的SDK。
Hope this could help someone !
希望这能帮助到一个人!
#2
2
This issue occurs when Android Debug Bridge aka ADB is not responding to the request from Android Studio. I killed the process adb.exe and started it again. This solved my problem.
这一问题发生在Android调试桥卡亚行没有响应来自Android Studio的请求时。我杀了亚开行。exe又开始了。这解决了我的问题。
#3
2
If you are using a real device :
如果你使用的是真实设备:
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
只要重新连接你的设备,确保你的电缆是可行的,你安装了合适的驱动程序。
#4
0
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
我遇到了同样的问题,我的问题是重新启动android studio。希望,这对你也有帮助。
#5
0
For me the following worked(after I tried the above points mentioned by others):
对我来说,接下来的工作(在我尝试了别人提到的几点之后):
- I tried debugging/running anther application. It was okay. So this pointed me to the direction that the current application has some problem
- 我尝试调试/运行另一个应用程序。这是好的。这就指向了当前应用程序存在问题的方向。
- if (point 1 == true) {I uninstalled the application from my phone manually }
- 如果(point 1 == true){我从我的手机手动卸载应用程序}
Then re-make/rebuild the application and debug/run worked
然后重新生成/重新构建应用程序和调试/运行工作。