"Starting Gradle daemon" loop creating endless processes - android

Whenever I open or create a project in Android Studio, and it starts to do its background build or whatever, it gets to "Starting Gradle daemon", but gets in a loop and never stops repeating that step. As a result, the build never finishes and it keeps creating Gradle daemon processes until the system runs out of memory and freezes.
This is in Ubuntu. It did work previously, and I don't know what could have changed to make it start happening. Has anyone else run into this problem and been able to fix it?

TL;DR: Turn off Windows Mobile Hotspot (aka, adHoc Adapter or Wi-Fi Direct Virtual Adapter) before your first build.
For some reason, while the hotspot is on, gradle server cannot accept incoming connections from /127.0.0.1 according to the log file in %userProfile%\.gradle\daemon\<version>\. And so, it keeps spawning new daemons thinking the old ones (sleeping in wait for connections) are dead.
Every time you need a new gradle daemon (eg. open a new project), you have to turn the hotspot off, wait for AS to connect to the daemon (eg. start building, sync gradle files, etc.), then re-enable it.
Notice that if you forget to disable the hotspot and start a build/sync process, your RAM will be filled with waiting gradle daemons. Kill them all before you try again or you will have an "Insufficient Memory" error.
I use this nice command in a shortcut file to kill all deamons with one click:
C:\Windows\System32\taskkill.exe /F /IM java.exe /T. Of course this is assuming you have no java processes other than gradle daemons (which is mostly the case when I'm working on AS), and you don't mind working daemons be restarted (which isn't a big deal imo).
This problem started only after upgrading from AS 4.0 to 4.1 and stayed for the next upgrades too.

I had the same problem on Linux.
I traced it down to a firewall misconfiguration. It prevented Android Studio from communicating with Gradle daemon using IP over loopback interface.

I have same Error on Win 10, I searched a lot but nothing helped me.
I off/on window firewall, defender, edit rules ...etc. no result
Solution is (may be)
restore all firewall settings.
old style Control Panel → System & Safety → Windows Defender → Restore Defaults
Note: options/words may not very similar, because it translated.
Update 1:
Other solution
is run Build before connect PC to internet, then after Daemon started connect to network, and builds will work fine.
or you can try disabling Daemon, or let it work offline.
I hope this could help someone.

for me:
disconnected the real device attached for testing,
which, i use for testing apps as well as for internet connection through tethering.
and hurray.
on more study,
found that the loose usb cable was culprit.

Related

Android Studio 3.0.1 Gradle issue (Error: The first result from the daemon was empty. Most likely the process died immediately after connection)

I have recently been encountering this issue to the point where I cannot continue working. When starting Android Studio Gradle builds as normal but as soon as daemon starts it fails and I get the Error:
The first result from the daemon was empty. Most likely the process died immediately after connection.
I have done a number of different things and I have searched all over the internet trying to find a solution for this issue so I can work on some projects I have but so far I have not had any luck. A few of the links I tried using to find a solution are:
Android Studio gradle build error: 'The first result of the daemon was empty.Most likely the process died immediately after connection'
Gradle sync failed: The first result from the daemon was empty. Most likely the process died immediately after connection
https://teamtreehouse.com/community/first-result-from-daemon-was-empty-gradle-build-continues-to-fail
https://www.jianshu.com/p/5891e7d46f6c
I have tried everything in those links and no matter what I do it does not work. I was so desperate to the point where I uninstalled Android Studio Gradle and all the SDK hoping that would fix it and that didn't do it either. I figured hey maybe it's another issue so I thought doing a clean install would do the trick and guess what it worked for a day or two and right after that back to the same place I started at now... (Worst part is I had to download over 200gb for the clean install due to all of the things I had to reinstall).
I am attaching a picture below in case anyone wants to see the original Gradle:
Android Studio Gradle Screenshot
I found the solution after installing and reinstalling the operating system and everything on it about 4 different times. So the issue was the network driver and the software it seems like. Every time after the network driver is updated using driver website it crashes and renders the network useless.
After a while looking at the logs I finally noticed a pattern that Gradle was having issues with something involving the actual network adapters and so what I did was uninstall the network software and uninstall all of my network adapters driver and restarted the computer and had Windows 10 reinstall the drivers. I opened the Android Studio and it works flawlessly. So at the end of the day, the basics saved the day.
In case anyone is wondering which network devices I have they are the:
Killer E2500 Gigabit Ethernet & Killer Wireless-n AC 1535 Network Adapter
The software is the killer network manager.
I had the same problem with the Killer network interface. The motherboard I'm using has 2 gigabit NICs and a wireless adapter built into it. One of the two gigabit ports is Intel.
I believe the problem is with the Killer gigabit port/ Drivers. To get around it I just disabled the Killer E2500 Gigabit Ethernet port and restarted Windows. Gradle and Android Studio are now working without issues.
Also the mobo I'm using is a Gigabyte X299 Aorus Gaming 7.
Seems they fixed it with the latest Killer driver:
"KillerPerformanceSuite_1.5.1847_Win7_Win81_Win10_x64"
Just tested it and it seems to be working.
Had the same issue, and the culprit was also Killer-related software as mentioned in the other answers, after uninstall the software (from Store and through the Control Panel), then uninstalling the drivers, then restarting.
Then, it started to work again, but I just randomly decided to try installing the Killer Drivers+Software again through KillerPerformanceSuite_2.0.1175_UWD_x64, but it broke Gradle again, so I decide to do all those steps again, but after uninstalling the software (through Control Panel), I decided to check Android Studio if it would sync properly this time, and it did.
So the culprit might actually just be the software (Killer Network Manager).

Everytime this message pops on my screen while connecting phone and avd don't detect my phone? [duplicate]

[2011-04-11 13:27:36 - ddmlib]An established connection was aborted by the software in your host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.java:573)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:419)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:840)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:808)
at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:767)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:635)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:42)
at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:563)
This problem can be simply solved by closing Eclipse and restarting it. Eclipse sometimes fails to establish a connection with the Emulator, so this can happen in some cases.
Checkout there might be two instances of Eclipse are pointing to same Android SDK...just keep one instance of Eclipse and try again...that's why you are getting Exception as "established connection was aborted by the software in your host machine"...go in details of android adb(Android Debug Bridge) you will get it...
I was getting these errors too and was stumped.
After reading and trying the two answers above, I was still getting the error.
However,I checked the processes tab of Task Manager to find a rogue copy of 'eclipse.exe *32' that the UI didn' t show as running. I guess this should have been obvious as the error does suggest that the reason the emulator/phone cannot connect is because it's already established a connection with the second copy.
Long story short, make sure via Task Manager that no other Eclipse instances are running before resorting to a PC restart!
If you develop in multiple IDE's or other programs that connect to AVD you should try closing them too.
Netbeans also can cause conflicts with eclipse if you set it up for NBAndroid.
I had the problem with multiple IDE. Closing Eclipse, killing from task manager or restarting didnt help. Just deleted the AVD and created it again.
SOLUTION :-
I was getting the same error as I was opening two eclipse window, so I close one eclipse window and run the app again. You will not get the error.
restart(close and start) the eclipse again if you have open only one eclipse window.
This problem may occur if you have two devices connected to the computer at the same time. Adb does not support reaching both devices via command/console. So, if you debug your app after connecting and disconnecting the second device you will most probably have this problem. One solution might be restarting adb and/or eclipse if necessary. It can be quite annoying sometimes and I am afraid there is no other solution to that.
This problem may also occur when you are opening Android Studio and Eclipse at once. Try to close one of them and it might solve your issue.
In My Case, I was running Android Studio and Eclipse at a time. AS and Eclipse were trying to communicate a device/emulator through adb.
Solution:
I closed Android Studio. Then I restarted Eclipse.
Hope this helps you :)
Close the emulator if already opened.
Right click on your project ->Run as -> run configurations -> Run.
After the emulator launched: Right click on your project ->Run as ->android project.
I encountered this issue on my Windows 7 64-bit development machine when running Android Studio 2.1.x and Android Studio 2.2.x side-by-side.
I had deployed an application via the 2.2.x instance the previous day and had left that IDE running. The next day I deployed a different application from the 2.1.x IDE and this is when I encountered the issue.
Shutting down both IDEs and then restarting the 2.1.x IDE resolved the issue for me.
Restarting the eclipse will solve the problem and kill the "adb disconnect" and then "adb kill-server"
On a Windows box, I wanted to avoid reboot and these did not work:
* /android/adt-bundle-windows/sdk/platform-tools/adb kill-server
* /android/adt-bundle-windows/sdk/platform-tools/adb start-server
So what did work to get adb running again without this error was
wait for the TIME WAIT to complete, which took multiple minutes. You can view the state of the ports and watch when to restart the debugger with this command: "PortQryV2/PortQry.exe -local" This tools is downloaded here: http://support.microsoft.com/?id=832919
force closing ports with "netsh int tcp reset"
The only thing that worked for me (under windows) was to reopen the IDE as administrator. All worked smoothly after that.
I solved this problem by closing Eclipse and restarting it again. Eclipse sometimes fails to establish a connection with the Emulator/device, so this can happen sometimes.
Running Eclipse Luna and using WifiADB app on my phone I started getting this error when Running my app from Eclipse. Oddly, in Indigo (I installed Luna last night) it was working fine.
The problem for me was I had the phone connected to the PC to charge it, and even when running a .bat script to kill ADB it appeared that a second instance was started when Run. Plugging the phone into the monitor to charge when debugging over wifi solved it. I need to debug on wifi sometimes to test my app stopping/starting on power state change.
Of course it reasonable to assume (highly likely) I've just not set Luna up the same.
This problem appear if two software use same port
generally Android studio use the port 5037
try to close the port by cmd according to your operating system
then reboot your Android studio or your Eclipse
I was having this problem.
Things I tried:
Restart Eclipse
Restart Eclipse & Kill adb as mentioned here.
Restart Machine & Open Eclipse
This is what worked for me
Powered off (pulled plug) my android device, Restart Machine, Power
on android device.
Hope this helps someone!
Close Eclipse
Open Task Manager and kill adb.exe
Start Eclipse
It should work.

Eclipse issue - Launch error: Failed to connect to remote VM. Connection timed out

I get the message
Launch error: Failed to connect to remote VM. Connection timed out.
each time i debug my application on read device. I added to the AndroidManifest the:
<uses-permission android:name="android.permission.SET_DEBUG_APP"/>
and
android:debuggable="true"
But still this is not helping. When i reset the Eclipse ( close it and open it again ) this problem sometimes solved. Its really hard to work in this way - How can i solve this problem?
I sometimes have this problem after I disconnect phone from the computer and reconnect again.
I do CTRL + ALT + DELETE and kill all adb.exe processes and it fixes it for me.
Please try if this also works for you.
Note: I find this faster than restarting adb from command line/eclipse
Just had this bug, tried several things, finally, changing the port worked. I was at port 8600, changed to 8601 and connects instantly! You can find this setting in Windows->Preferences->Android->DDMS. Change default port, apply, and restart Eclipse.
Just uninstall the app from your device and run the debug again.
I don't know why, but this works for me: First Run(or Debug) your application in an emulator and then Debug the application on the device (without closing the emulator).
I know it is not a good solution though, but it's easy.
Another thing to try:
In my case I had 2 instances of eclipse running
To solve:
Close eclipse
Use task manager to kill any additional eclipse processes that are running
Restart eclipse
When running my APP as an Android Application on a Galaxy SII, all worked fine.
When debugging the same app, I got the error:
Launch error: Failed to connect to remote VM. Connection timed out.
On my Windows XP there was installed JRE 1.7. After uninstalling Java 1.7 completely, and installing JDK 1.6u26, I was able to debug my app.
In Eclipse...
Window --> Preferences --> General --> Network connections, choose 'Native' as Acrive Provider.
I had this problem and I became crazy.
Now I've resolved.
I had the AVG 2013 on my system, I uninstalled it and everything is working fine. I guess AVG was not allowing the emulator to open the port for debugger.
Yeah, I've been having this problem a lot these last few weeks.
StackOverflow does not lack in offered solutions, but most involved restarting or killing something.
I noticed the error message included the phrase, 'Connection timed out.', and so I hoped that there was some setting to extend that time and so the attachment wouldn't time out.
There is!
What worked for me was to increase the 'timeout' time.
I'm currently on Eclipse Kepler (Build id: 3.0.3-20140327-1716-Typesafe)
Under the Windows menuu -> Perferences -> Java -> Debug
Near the bottom of the window you will see the following field: Debugger timeout(ms): 3000
I just added another zero, 30000, and my troubles were no more.
You may find that your breakpoints continue to be skipped initially, but wait!
With this long timeout time now, just keep running past those breakpoints until the debugger successfully attaches and boom! You're stopping at breakpoints.
Better still, start up your app in 'debug mode', fold your arms, wait 30 secs or more...then have at her!
It was the following link that lead to this revelation:
getting Launch error: Failed to connect to remote VM. Connection timed out. which trying to debug my app on my device in android

An established connection was aborted by the software in your host machine

[2011-04-11 13:27:36 - ddmlib]An established connection was aborted by the software in your host machine
java.io.IOException: An established connection was aborted by the software in your host machine
at sun.nio.ch.SocketDispatcher.write0(Native Method)
at sun.nio.ch.SocketDispatcher.write(Unknown Source)
at sun.nio.ch.IOUtil.writeFromNativeBuffer(Unknown Source)
at sun.nio.ch.IOUtil.write(Unknown Source)
at sun.nio.ch.SocketChannelImpl.write(Unknown Source)
at com.android.ddmlib.JdwpPacket.writeAndConsume(JdwpPacket.java:213)
at com.android.ddmlib.Client.sendAndConsume(Client.java:573)
at com.android.ddmlib.HandleHeap.sendREAQ(HandleHeap.java:349)
at com.android.ddmlib.Client.requestAllocationStatus(Client.java:419)
at com.android.ddmlib.DeviceMonitor.createClient(DeviceMonitor.java:840)
at com.android.ddmlib.DeviceMonitor.openClient(DeviceMonitor.java:808)
at com.android.ddmlib.DeviceMonitor.processIncomingJdwpData(DeviceMonitor.java:767)
at com.android.ddmlib.DeviceMonitor.deviceClientMonitorLoop(DeviceMonitor.java:635)
at com.android.ddmlib.DeviceMonitor.access$100(DeviceMonitor.java:42)
at com.android.ddmlib.DeviceMonitor$3.run(DeviceMonitor.java:563)
This problem can be simply solved by closing Eclipse and restarting it. Eclipse sometimes fails to establish a connection with the Emulator, so this can happen in some cases.
Checkout there might be two instances of Eclipse are pointing to same Android SDK...just keep one instance of Eclipse and try again...that's why you are getting Exception as "established connection was aborted by the software in your host machine"...go in details of android adb(Android Debug Bridge) you will get it...
I was getting these errors too and was stumped.
After reading and trying the two answers above, I was still getting the error.
However,I checked the processes tab of Task Manager to find a rogue copy of 'eclipse.exe *32' that the UI didn' t show as running. I guess this should have been obvious as the error does suggest that the reason the emulator/phone cannot connect is because it's already established a connection with the second copy.
Long story short, make sure via Task Manager that no other Eclipse instances are running before resorting to a PC restart!
If you develop in multiple IDE's or other programs that connect to AVD you should try closing them too.
Netbeans also can cause conflicts with eclipse if you set it up for NBAndroid.
I had the problem with multiple IDE. Closing Eclipse, killing from task manager or restarting didnt help. Just deleted the AVD and created it again.
SOLUTION :-
I was getting the same error as I was opening two eclipse window, so I close one eclipse window and run the app again. You will not get the error.
restart(close and start) the eclipse again if you have open only one eclipse window.
This problem may occur if you have two devices connected to the computer at the same time. Adb does not support reaching both devices via command/console. So, if you debug your app after connecting and disconnecting the second device you will most probably have this problem. One solution might be restarting adb and/or eclipse if necessary. It can be quite annoying sometimes and I am afraid there is no other solution to that.
This problem may also occur when you are opening Android Studio and Eclipse at once. Try to close one of them and it might solve your issue.
In My Case, I was running Android Studio and Eclipse at a time. AS and Eclipse were trying to communicate a device/emulator through adb.
Solution:
I closed Android Studio. Then I restarted Eclipse.
Hope this helps you :)
Close the emulator if already opened.
Right click on your project ->Run as -> run configurations -> Run.
After the emulator launched: Right click on your project ->Run as ->android project.
I encountered this issue on my Windows 7 64-bit development machine when running Android Studio 2.1.x and Android Studio 2.2.x side-by-side.
I had deployed an application via the 2.2.x instance the previous day and had left that IDE running. The next day I deployed a different application from the 2.1.x IDE and this is when I encountered the issue.
Shutting down both IDEs and then restarting the 2.1.x IDE resolved the issue for me.
Restarting the eclipse will solve the problem and kill the "adb disconnect" and then "adb kill-server"
On a Windows box, I wanted to avoid reboot and these did not work:
* /android/adt-bundle-windows/sdk/platform-tools/adb kill-server
* /android/adt-bundle-windows/sdk/platform-tools/adb start-server
So what did work to get adb running again without this error was
wait for the TIME WAIT to complete, which took multiple minutes. You can view the state of the ports and watch when to restart the debugger with this command: "PortQryV2/PortQry.exe -local" This tools is downloaded here: http://support.microsoft.com/?id=832919
force closing ports with "netsh int tcp reset"
The only thing that worked for me (under windows) was to reopen the IDE as administrator. All worked smoothly after that.
I solved this problem by closing Eclipse and restarting it again. Eclipse sometimes fails to establish a connection with the Emulator/device, so this can happen sometimes.
Running Eclipse Luna and using WifiADB app on my phone I started getting this error when Running my app from Eclipse. Oddly, in Indigo (I installed Luna last night) it was working fine.
The problem for me was I had the phone connected to the PC to charge it, and even when running a .bat script to kill ADB it appeared that a second instance was started when Run. Plugging the phone into the monitor to charge when debugging over wifi solved it. I need to debug on wifi sometimes to test my app stopping/starting on power state change.
Of course it reasonable to assume (highly likely) I've just not set Luna up the same.
This problem appear if two software use same port
generally Android studio use the port 5037
try to close the port by cmd according to your operating system
then reboot your Android studio or your Eclipse
I was having this problem.
Things I tried:
Restart Eclipse
Restart Eclipse & Kill adb as mentioned here.
Restart Machine & Open Eclipse
This is what worked for me
Powered off (pulled plug) my android device, Restart Machine, Power
on android device.
Hope this helps someone!
Close Eclipse
Open Task Manager and kill adb.exe
Start Eclipse
It should work.

How to resolve "Waiting for Debugger" message?

I have HTC Comet connected to Eclipse with SDK 2.2. I do a debug build - the application does not run; though it does get installed on the device. On the device I get this message box on the Comet screen
Waiting for Debugger
Application HunyDew (process com.airvine.hunydew) is waiting for the debugger to attach.
[Force Close]
Whereas in the Eclipse console I get these set of messages
[2010-12-07 01:42:29 - hunydewprj] Android Launch!
[2010-12-07 01:42:29 - hunydewprj] adb is running normally.
[2010-12-07 01:42:29 - hunydewprj] Performing com.airvine.hunydew.HunyDewAAStartsHere activity launch
[2010-12-07 01:42:47 - hunydewprj] Application already deployed. No need to reinstall.
[2010-12-07 01:42:47 - hunydewprj] Starting activity com.airvine.hunydew.HunyDewAAStartsHere on device 308730C861BC
[2010-12-07 01:42:49 - hunydewprj] ActivityManager: Starting: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] cmp=com.airvine.hunydew/.HunyDewAAStartsHere }
[2010-12-07 01:42:49 - hunydewprj] Attempting to connect debugger to 'com.airvine.hunydew' on port 8601
[2010-12-07 01:43:09 - hunydewprj] Launch error: Failed to connect to remote VM. Connection timed out.
The application runs fine in the Emulator - please help - what is it that I am missing here? Any hints/suggestions? Thanks
Some devices will only let the debugger attach if the application has the android.permission.SET_DEBUG_APP permission set in its manifest file:
<manifest>
<uses-permission android:name="android.permission.SET_DEBUG_APP"></uses-permission>
</manifest>
The Dialog Waiting for Debugger is shown if you are building a debug application or somewhere in your source code, you called Debug.waitingForDebugger();
Inside Android Studio 2.0 and above, there is an option of Attach Debugger to Android Process. It is the last menu item in the Run menu.
Not sure if this is what you are looking for, but try putting:
android:debuggable="true"
in the application tag in the AndroidManifest.xml
I've got this problem for long that I cant get my android emulator or device connect to the debugger while both the console and the emulator were displaying waiting for connecting to the debugger.
And configuration for debug inside eclipse also confused me so much before, but today, i got this problem solved, by the following steps:
When you want to debug a android project, for instance, mypro. you would right click on it in the "Package Explorer". Then choose "Debug as"-->"Android Application".
Then the emulator might stop at the "Waiting for connecting to debugger"(or something else similar to this).
Then you need to connect to the debugger yourself by click "DDMS" to open the DDMS perspective, and click "Devices" tab.
Then you can see a list of processes that are running on your emulator or device.
Double click on the one which you are debugging, then change to the Debug perspective, you can see the debugger is connected and you could debug your program. That's how I solved this problem.
By the way, my OS is Win7 32-bit. Eclipse's version is Helios Service Release 2. Android SDK is rev. 16 and platform-tools' 10.
Update.
I found that it is the problem of my TCP/IP configuration. The debugger can't be connected when i assign a static IP address(for access to internet).
So every time when the debugger is unable to connect, I always do the following steps:
1.close current eclipse window.
2.change the config of IP address to dynamic, it means getting a IP address by DHCP.
3.open up the eclipse again.
then the debugger is able to be connected. I thought it might be a issue of the internal mechanism of java debugger which is using socket connection.
I get this if I switch the usb cable to a difference port on my PC, odd but it works when I switch it back again. Also I think I've got this when there's been another device or emulator running at the same time, or two instances of Eclipse open.
For those getting this annoying behavior in 4.2.2 you have to un-check the setting for "wait for debugger" in the developer options. Of course, those options were hidden by Google, and you have to do a sneaky trick to get them to show back up. I had set them before they disappeared, and couldn't for the life of me find them again.
This page explains the procedure
Running Android Studio, I ran into this problem and after trying various remedies restarting Android Studio is what appeared to fix the problem.
My solution is to use the Dalvik Debug Monitor. Sometimes there is a red or green bug beside a process. Click on the device you're trying to load to. Select the Actions tab and reset adb. This usually attaches the debugger for me. I find that doing debugging through this Monitor works better for me than using the Android Eclipse plugin Logcat.
Closing the emulator and closing eclipse. Reopening Eclipse and starting the simulator worked for me.
The key thing to look for is in the Devices pane of Eclipse. If you start the emulator or device and it shows up in the device name list but says [null] and no running processes show beneath it, then it won't work correctly with loading your app into it.
If the name of the device comes up and is Online then things seem to work smoothly.
Don't know why it doesn't work out all the time though.
In my case, the problem is caused by adb connected with another device.
If several devices are connected in PC, remove other devices except required one.
I end up going into "Debug" perspective.
Then in the "Debug" frame, there are debug list or running list.
You have to decide which one is your current one that has this problem (Waiting
for debug...)
Then do right-click and choose "Terminate and Remove".
Then you try to run again. And that warning box will be gone.
I solved this issue this way:
Go to Run menu ====> click on Edit Configurations ====> Micellaneous and finaly uncheck the option Skip installation if APK has not changed
Rebooting the phone was the solution for me.
If your development environment is Windows make sure the USB drivers are correctly installed.
One way to ensure that the USB drivers are installed correctly is to get the PDANet Windows installer and let it install the USB drivers.
You can find the PDANet page here.
I would try to connect to the phone with ddms on its own without Eclipse. You might be running an emulator inside eclipse that you dont see or have some other problems with Eclipse.
Just run ddms from a command prompt and see if the device appears and you can connect to it.
You can also see if appears when you run adb devices and see that your phone is listed (and maybve something else..)
I got the same problem, I know I wasn't running any other instances, and I could see it with adb devices. I just did a restart of eclipse and it worked.
Rebooting the PC was the only thing that worked for me. It worked when I had this problem with an Android 2.2 phone, and also an Android 3.1 tablet.
I ran into this problem today. After spending most of the day trying to fix it, the only thing that ended up working was to create a new workspace and import my project into it. I hope this helps someone avoid all the trouble that I went through.
I also enounter this problem. In my environment, I use a tomcat as server and android as client. I found,
If tomcat is started, this error " Launch error: Failed to connect to remote VM. Connection timed out." will occur.
If tomcat is not run, adb works well.
I tried all the solutions above, it fixes the issue sometimes, but still from time to time I happened to get stuck with the "Waiting for the debugger to attach" message box.
The final solution in my case was to unplug all the Android devices but the one I want to debug on. I don't know which one is the culprit: the Nexus 7 running JB 4.2, the HTC One X running ICS, the HTC Desire S running Gingerbread, or the combintation of the 3, but as soon as I only have one device plugged in, it runs smooth as silk.
I used Task Manager to kill adb.exe to solve this problem. Adb.exe will automatically start after being killed.
Killing adb.exe has solved a lot of problems related to debug and emulators for me so far.
For Android Studio users I encountered this problem first time while trying to run a bare
bone project just after updating my jdk location. So I stumbled across this post. In my case simple Build->Clean Project did the job.
I was also having the same problem when using Android Studio and GenyMotion.
I am able to solve this problem by pausing the program and resuming it again after "Waiting for debugger" message is shown. It may work while using other IDEs and emulators as well.
Android Studio 1.2.2 on Mac OS 10.10
Same problem as others have reported.
I closed Android Studio, then checked from command line in terminal:
ps -efw|grep -i android
This reported a java process (.gradle/daemon) associated with Android Studio. I killed this process, restarted Android Studio, and the problem went away.
disable you developer option in your phone.
Settings > Developer option > Disable
This worked for me, when i tried to use my application without debugging it.
What solved the problem for me was going to:
"Run"->"Attach Debugger to Android process" and then select your process.
You do this in Android Studio.
I had the same issue, fixed it by explicitly selecting desired device in debug configuration. Unfortunately, even after that log sometimes stops when debugger tries to connect. In this case in DDMS perspective find the desired process. It will be highlighted with green bug. Click stop and then debug it again.
This may be old, but for Genymotion's latest update 2.7.1, go to Developer options, if in case you dont know how to open that option, go to About phone and click Build number few times and Developer options will be enabled. Turn ON Developer option, check USB debugging.
Tested on Genymotion 4.4 and up.
Weird solution eh ? But definitely works. Hope it helps.
Happy codings.
In Debug mode Android Studio connects to your Device via socket(:8600). Somehow your socket connection is choked and thus not responding to incoming connections.
Restart Android Studio and your problem will be resolved
"Wait for debugger"in Developer options may have been set to wait your application.Please clear that option and application should run normally.

Categories

Resources