Every other time I launch my app in an AVD I get this happy little error popping up:
Error running app:
Unable to open debugger port (localhost:8611): java.net.ConnectionException "Connection refused"
(would have posted a screenshot, but my reputation does not allow it)
It doesn't break anything, and after a couple relaunches it's back on track, but it's starting to annoy me. Does anyone know how to fix this? And I'm looking for a permanent fix, not a fix that would require me to do ten things over and over again every time this happens
Android Studio version 1.5.1 on Debian 8.2 using Oracle's java 1.8.0_66.
Also, to clarify, this is not an issue with my code. I can launch a completely empty project and still get this error popping up to say hi.
Running adb start-server in a standalone terminal yields the following:
cytodev#GE72-2QE:~$ adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
This uses a different port than the debugger port Android Studio uses, but I'm guessing that is normal.
There is an issue around IP v6 and how localhost is handled.
To fix the problem you will need to modify host file - see instruction.
(I don't deal much with Linux but I think it's similar configuration for both Windows and Linux)
Windows (Must open with administrator permission)
locate host file - C:\Windows\System32\Drivers\etc\hosts
uncomment (remove #) the following line:
# ::1 localhost
Linux (Must open with root)
locate host file - /etc/hosts
either add or uncomment ::1 localhost to the configuration file
Related
I know this question has been asked many times - I've read them all and followed most of the suggestions.
I have a new computer, windows 10, so a clean install of AS 3.5.3 . All fine, except trying to get adb to work. I get 'Unable to locate ADB' when after finding no devices I try to restart ADB.
There's also a series of error messages in the event log:
18:16 Adb connection Error:An existing connection was forcibly closed by the remote host
18:16 Unable to open connection to: localhost/127.0.0.1:5037, due to: java.net.ConnectException: Connection refused: connect
18:16 Connection attempts: 1
18:16 * daemon not running; starting now at tcp:5037
18:16 * daemon started successfully
adb.exe is visible in the right place in platform-tools. But I've tried deleting and reinstalling platform-tools. Reinstalling AS, and not using old setup configurations. I've run AS as an administrator, checked file properties in platform-tools, rebooted the computer, I don't have antivirus except windows defender, and I've run that over the platform-tools folder and it didn't object to that... so I've run out of ideas! The setup looks just the same as in my old computer, and everything works on my old computer (but slowly!).
Any other suggestions? Are those error messages significant.
Thanks.
I should have said I was trying to connect adb using wifi. I installed and android wifi adb plugin (File, Settings, Plugins) and now it's working.
I have 2 other machines with AS on them, and adb over wifi works fine and I never had to do this before.
Edit: I have been asked not to use this post as an answer. It's true, my experience doesn't offer a useful solution to anyone (can't be sure that installing the adb plugin actually helped) but adb is working now, so I don't need anyone bothering themselves trying to figure out a problem that no longer exists. In that sense, it's an answer.
Am trying to view my database tables using Android Device Monitor and It showing me Errors for reasons which i am not really sure of. And i don't have another instance of DDMS running.
Instead of showing my DDMS, Its showing me this errors
[2015-09-10 17:39:53 - ddms] Could not open Selected VM debug port (8700). Make sure you do not have another instance of DDMS or of the eclipse plugin running. If it's being used by something else, choose a new port number in the preferences.
[2015-09-10 17:39:53 - ddms] Can't bind to local 8600 for debugger
[2015-09-10 17:39:53 - ddmlib] Broken pipe
java.io.IOException: Broken pipe
at sun.nio.ch.FileDispatcherImpl.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(SocketDispatcher.java:47)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(IOUtil.java:93)
at sun.nio.ch.IOUtil.write(IOUtil.java:65)
at sun.nio.ch.SocketChannelImpl.write(SocketChannelImpl.java:487)
at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.java:677)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:523)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:847)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:815)
at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:775)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:664)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:46)
at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:592)
Please, any one knows a solution to this ???
Try killing the adb server and restarting the adb server from terminal.
adb kill-server
adb start-server
Also on your mobile device, toggle the usb debugging.
Both of these combine worked for me when I had this issue.
Also you may want to consider using Stetho by Facebook, you can view your database as well as run queries with Stetho. Stetho also lets you watch network calls, view your view hierarchy and more.
On Mac, Open terminal and type:
sudo nano /etc/hosts
Add following line to your hosts file
127.0.0.1 localhost
Save and exit.
In Android Studio, you can start debugging again. I got stuck with the same problem and I ended up doing above, problem solved.
Hope this helps :) .
For osx users
Yes you need to restart adb. Simply restart android studio should do the trick. If it's still not working, force killing the thread on port 8600 by this
[sudo] lsof -i :8600
Then for the PID
kill -9 <PID>
A similar question helped me solve this issue here:
Android Studio and android device monitor
By opening DDMS from within Android Studio, I am able to bind and monitor my android devices with no more broken pipes or port conflicts.
Simply follow these steps to open DDMS from within android studio:
Select Tools > Android > Android Device Monitor
I can only assume AS runs a DDMS instance silently, since when AS is closed, manually opening DDMS has no issues. Only when AS is running do I get this when running DDMS from the CLI
What worked for me was restarting the computer. I think this happened after force-quitting Android Studio.
in case of converting your webapp into android app.
if u give your url like this : localhost:xxxx/abc/xx
then it create the problem because the port of your localhost and port of your emulator is different. you are using emulator it work like a separate device in your computer.
SO FRIENDS USE IP ADDRESS INSTEAD OF LOCALHOST AND IT WILL WORK ...101% WORK I AM SURE
For some reason eclipse DDMS always gives the error 'Can't bind to local 86XX for debugger' every time I try and debug my app. This just started today for some reason.
I have looked at many posts and tried what they have suggested such as:
1. Adding 127.0.0.1 localhost to the hosts file and moving ::1
2. stopping and restarting adb
3. Under Window -> Preferences -> Android -> DDMS:
Set Base local debugger port to "8601"
Checked the box that says "Use ADBHOST" and set the value to "127.0.0.1"
I have also restarted the computer, updated Android platform tools and the eclipse plugin, Downloaded the latest adt-bundle and started the eclipse that is bundled with that.
I have ran netstat -anob and only javaw and adb use ports 8600+.
Does anyone have any ideas what I can try now?
If you are using Linux, I recommend you as well to run this command:
fuser -k 8600/tcp
With this command you will kill any process running at the 8600 TCP port (The one Android is using to debug).
I had same problem and none of given solutions worked. Then I have uninstalled all JRE 7 and installed latest JRE 6 (http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html). It have immediately fixed the problem.
I have the same problem. I tried really everything, all hints from the web.
I tried:
different versions of JRE and JDE
different ports
different mobiles
modified hosts file
changed preferences ddms
disabled the firewall completely
disabled all IPV6 functionality
I restarted the adb every time
I use Windows 8
Under many many tried it worked for two times. After exiting the debug session and starting another without any changed, the same shit started again....
BUT: I copied the whole environment path with eclipse and android sdk to antoher windows 8 machine, where it works without any problem!
One of the reasons for getting this error could be that there is an existing DDMS session open which is using the port. This is what happened with me. I had Device Manager open when I got this error. After closing the Device manager, I did a clean build and then it worked ! Guess DDMS and debugger are trying to use the same port which results in the problem.
If you are using Windows, then kill any process running at the port 8600 using the two following commands:
netstat -a -n -o | findstr :8600
It should give something like
TCP 127.0.0.1:8600 0.0.0.0:0 LISTENING 7508
Then run
taskkill /F /PID 7508 :: replace 7508 with the displayed PID
I solved this problem like this:
open powershell (Available in all windows after XP). Its a command Prompt. Give the command
> netstat -nao
It will list all the TCP and UDP port that are active on the computer. Find the entry whose local address contain some IP address : 8600. This is the TCP port that you wish to close.
Note the PID of this entry. In the powershell, give another command
> Stop-Process -Id PID
Here the PID is the one we have noted. Now start the debug from eclipse, it should bind the 8600 port with no further problems.
I installed android in eclipse, everything is fine but after launching the AVD, emulator was not opening. At what situations it will happen? It was showing error like
[2012-07-19 17:09:04 - DeviceMonitor] Adb connection Error:An existing connection was forcibly closed by the remote host
Check out this -
"The connection to adb is down, and a severe error has occured."
as well
Error: "Adb connection Error:An existing connection was forcibly closed by the remote host"
Or you can do one thing give correct path of android-sdk-windows.
I had some problems with the emulator button in eclipse, too.
Some times it just wont't fire the emulator up. I actually have no guess why this is (maybe it opens up in another dimension where you can't see it :P).
I worket around this issue by simply not using the button ;).
I start the emulator manually.
On linux after creating your emulator configurations you can start an emulator from the command line.
In your Android SDK folder there is a subfolder "tools".
You can run the "emulator" program and give it the name of the AVD configuration as first argument.
emulator #My_AVD_Configuration_Name
You have to put the # token in front of the name.
Then you can install your APK file by using the "adb" program.
The "adb" program is in the "platform-tools" subfolder in your Android SDK.
Just write.
adb install -r MyAndroidApp.apk
I hope this helps a bit :)
This question already has answers here:
Eclipse error "ADB server didn't ACK, failed to start daemon"
(23 answers)
Closed 4 years ago.
I am a Android newbie. I guess I might be doing something stupid here. I have started the Virtual Device and I see that adbd daemon is running from the Terminal Emulator. When I run adb devices I get the following error:
C:\Program Files\Android\android-sdk\tools>adb devices
* daemon not running. starting it now on port 5037 *
ADB server didn't ACK
* failed to start daemon *
error: cannot connect to daemon
No other process is using port 5037. What am I doing wrong? Here are the packages I have installed -
1) Android SDK Tools, revision 10
2) Android SDK Platform-Tools, revision 3
3) SDK Platform Android 2.3.3, API 10, revision 1
This will occur normally,if abd is not able to launch properly and didn't exit when adb kill-server is executed.
So if in Windows
1. Go to Task Manager (CTRL+ALT+DEL)
2.look for adb.exe and end the process.
Now restart the emulator ,should work properly.
additionally you can close and launch the development environment also (eg: Eclipse or NetBeans).
I suspect the problem is cause of many adb instances (in windows) , i usually face this problem cause i don't turn off my system so the adb process may not end properly.
So open task manager choose Process tab just search for adb.exe, right click on it and choose End Process Tree rather than just End Process
Had the same problem, it seems that my security solution was blocking adb.exe
this is not the right folder for adb : lately adb has moved from /tools to /platform-tools in the sdk folder.
Seems like the security program is blocking adb.exe, so go to the adb file path and open adb's properties, then check the Run this program as administrator setting.
In my case the process adb.exe starts when i connect the phone, and then when I adb devices then I have your problem, and killing the process does not help it is resurrecting like a stubborn zombie, as long as the phone is connected.
so my solution was to disconnect the phone, then kill adb.exe process, then start it by adb devices and connect the phone
After that when i command adb devices i ma getting the same prompt about killing adb out of date, but this time on the second line is * daemon started sucessfully*
win xp
htc sensation
the new eclipse adt sdk bundle from google so i suppose up to date.
I found there was a process call "Tadb.exe" in Windows Task Manager.
I guess Tadb.exe is a similiar adb application of Tencent. Because I got an alert of "android device detected by QQ" after I install the last version of Tencent QQ2013 Beta5 (6970) yesterday.
After I killed the Tadb.exe, the original adb.exe of Android SDK works again.
You can see the detailed proecss to solve this problem here:
adb cannot run, adb server is out of date
I turned off the Windows Firewall and its working like magic. I am connected to the Internet through WiFi. If you are not behind a proxy and are still unable to access the Internet through a wireless link via the emulator, go to Device Manager and disable your LAN card.
As I have tried as follow by combining omni.present's method , and finally emulator works fine.
firstly I stop adb.exe process in the task manager
then I stop and start eclipse
The fundamental reason is because the 5037 port on your machine to be occupied by a process, not only Android devices can not use adb connection ios device not use iTunes.
Can query process and close it, netstat / a / o maybe can help you to take up to 5037 ports.
To windows7 the LogsAndAlerts service will occupy port 5037.