This question already has answers here:
adb cannot start daemon, CreateProcess failure, error 2
(7 answers)
Closed 4 years ago.
i got this problem that is annoying me after updating to 1.3 , i fired up Android Studio and got a message saying :
***Unable to establish a connection to adb
This usually happens if you have an incompatible version of adb running already.
Try reopening Android Studio after killing any existing adb daemons.
If this happens repeatedly ,please file a bug at http://b.android.com including the following :
Output of the command 'C:\Users\username\AppData\Local\Android\sdk\platform-tools\adb.exe devices'
2.you Idea.log file (Help |Show log in explorer)***
Whats the solution ,i'm running Win7 32bit
You need to kill the adb process that is running, to do so,
Go to Spotlight search, open Activity Monitor,
Loop for adb under CPU tag,
Now Select it and Force Quit the process.
You can kill adb process through Terminal command too, by simply typing Kill -9 adb
Note: Sometimes When u tried to force close them they kept restarting. Make sure you quit any emulators and disconnect any devices to avoid any mistake.
I spent around a complete day to look for the solution but couldn't find an exact one.
Finally what i did was that I uninstalled my antivirus and after that it worked like a charm.
So, here I shortlist the steps to check whether you are solving for the correct problem or not:-
Run command prompt and set path to where adb.exe file is present. (In most of the cases it's found at C:\Users\YOUR_USERNAME\AppData\Local\Android\Sdk\platform-tools)
Type adb start-server and press enter.
If there is an error displayed saying something like "Cannot connect to daemon" , then you must look in your antivirus for firewall settings and add the path to its exceptions or you can simply uninstall your antivirus.
In tools menu,Android->
untick enable adb Integration
and Then
OPEN widows task manager n manually end process adb.exe This also solved my issue as der were multiple adb.exe running.
Restart the computer. Now, disconnect the device, connect it, Make sure USB debugging Option is enabled. Now, pull navigation drawer and select the option USB for file transfer. In the dialog; there are few options such as ;
Transferring media files
Transferring images
Connecting MIDI devices
None
select None and now select Transferring media files.
Now, check Android studio, and select Android Monitor and check whether device is attached or not.
Thank you !! I hope it helps for your problem.
This happened to me after upgrading to Windows 10. I got the same error you did, but what was helpful was the extra message about not finding the adb version in the very bottom left corner of the Android Studio screen. That led to this: Solution: How to Fix Android Studio’s ‘Unable to Obtain Result of Adb Version’ Error
In short, it was a problem with my Avast firewall blocking the connection. I added the sdk and Android Studio paths to my firewall exception list and it worked!
Related
When im run android studio, or run emulator for android studio with manually or with cmd, always get bluescreen.
it say "your pc ran into problem and needs to restart. we're just collecting some error info, and then we'll restart for you"
Stop code: IRQL Not Less or Equal
how can i fix it ?
im trying download another emulator and following tutorial on youtube, but it didn't work
It depends on various factor,
I happened to get this issue because of my old PC with Lesser RAM size(4GB) and to rectify it, I connected my Android phone to PC for debugging/running apps from Android Studio.
You need to enable USB Debugging in your phone for that purpose.
NOTE:
You can view this blog post I made, which addresses the same issue.
https://whysurfswim.com/2015/07/11/sick-of-your-avd-theres-a-alternate-for-it/
I had almost same problem. When I tried to install my app in emulator(Ram 8gb), my emulator crashes but kept running in background. As a result, I was unable to shut down my pc and have to disconnect power for shutting down.
use your phone for debugging your app. you can connect your phone using wifi. link here
Sometimes it happens beacause of outdated drivers, try updating your drivers to latest version, and update the windows 10 to latest version. Also try by deleteing your current emulator device and create new device by enabling software renderer. For lower end pcs like yours I would recommend to use real device instead of emulators ans use ssds for better performances.
I'm taking the first steps in android development. Started working through this guide https://developer.android.com/training/basics/firstapp/running-app and the error occurred when the program is run on the device.
First of all, my device is not in the list of connected in Android Studio:
adb devices doesnt see my device when Android Studio is running, but if I close Android Studio, adb devices shows my device
When Android Studio starts, it shows an error and logs all the time this error flashes:
I tryed this this solution but it didnt solve my problem:
I dont know, why Android Studio try to connect to weird address localhost/127.0.0.7:5037?
I forgot. I edited /etc/hosts and commented line
#127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
After uncommented the line and restarted the Android Studio, I've solved my problem.
in my case in /etc/hosts I had the following line that i removed
0.0.0.0 localhost
I've catched this error under:
Android Studio 3.1.4
Android Debug Bridge version 1.0.32, Revision eac51f2bb6a8-android
Also i'm working in the office with some active firewall, antiviruses, monitoring etc.
My local host in the "/etc/hosts" was commented.
I solved this issue, but it was only an adb connection problem.
First, you have to enable all features in a device's developer menu
(debug with USB, upload via USB, usb connection type - charge only),
security menu (allow unknown sources);
Second, you have to set an allowance on the device to accept commands
from a current PC. Some devices do not show a dialog. To force this,
open a terminal console in the Android Studio, type in a command
"adb logcat" (this push adb to connect with current device), you
should see a dialog on the device's screen. Choose "Allow". To exit
from logcat command, press ctrl+x/ctrl+c or ctrl+break;
After this, you should see the device in the Studio's logcat drop box as [disconnected];
Open the consloe again and type "adb wait-for-device", this should set a stable connection with device.
It helped me.
I had a similar issue with Android Studio 3.3.1 (MacOS) when I run my app, it could not detect any devices in the Select Deployment Target dialog window after initializing adb. It produced the following error:
Unable to open connection to: localhost/10.0.2.2:5037, due to: java.net.ConnectException: Connection refused
I checked in /etc/hosts, and found the following line:
10.0.2.2 localhost
Commenting out that line solved the issue.
In windows 10 I to need add path of ADB directory to environment PATH. And It helps.
The problem can be due to the fact that it is missing the adb driver for the specific phone, as you can verify from the device manager.
You have to donwload and install it from the manufacturer, if it is available.
In my case, this seems to be still an open issue, but I've finally found the correct driver and installed it, as suggested in the developer documentation, by following the appropriate links (in my case I landed in a xiaomi Chinese page, containing the link to the rar archive of the working driver).
Having done that first, I could finally see an unauthorized device from adb devices (before that, no device was found instead, since it was unrecognized at the operating system level in the device manager) and, eventually, the suggestion from Sergio, typing adb logcat in the terminal, finally prompted the authorization from the device.
Issue solved!
Check if the port is binded to any other connection in your computer. This may be the error which is caused de to ports inavailability.
This Error ConnectException is caused due to SocketException so i will start digging with the port's status.
I am running Android Studio on Windows 10 64 bit. I upgraded to the latest build and SDK the morning of 5/20, and since then I get the above error when opening Android Studio. I also get the 'Unable to obtain result of 'adb version' in the event log. If I launch the application (which worked fine before the update) the 'Select Deployment Target' window appears, showing 'Initializing ADB' with a loading graphic for a few seconds, which then results in a 'Nothing to show' message. Previously I had 4 different emulators set up, and an active device connect via USB. Now ... nothing.
Creating a new emulator has no effect - I go through the steps and still see the 'Nothing to show' message.
I have tried the following:
Reverting to older platform tools
Removing and re-installing the latest platform tools
Removing and re-installing Android Studio completely
Installed Genymotion to try emulate through that (I can create and start the emulator in Genymotion, it makes no different to the above issue in AS)
killed adb.exe through Task Manager, then ran adb tcpip 5555 through the terminal, the output was:
daemon not running. starting it now on port 5037 *
daemon started successfully *
restarting in TCP mode port: 5555
Which was encouraging, but the same issue described above persists (even after a restart of AS).
Switch to USB mode and back to TCPIP through adb in the terminal, no luck.
Migrated the entire project to Eclipse until I ran into support issues with Google Play Services (so I'm going to have to stick to AS, but I am getting desperate here)
Anyone that can assist - I would greatly appreciate it.
UPDATE - 5/23
I did a search for adb.log and found it in a temp folder on a completely different drive to the one that contains AS or my project files. Closed everything down, killed adb.exe through the task manager and deleted the file. Upon relaunching AS I received the following message:
screenshot of message
I could start/kill ADB through the terminal. adb devices resulted in an empty list. My idea.log file is filled with entries as from the date my trouble started. Restarting AS again resulted in the usual 'Unable to create Debug Bridge: Unable to start adb server: Unable to obtain result of 'adb version'' message.
Here is the last entry in my idea.log file:
2016-05-23 10:13:19,081 [ 824808] INFO - tools.idea.ddms.adb.AdbService - Initializing adb using: E:\Users\JakeSabre\AppData\Local\Android\sdk\platform-tools\adb.exe, client support = false
2016-05-23 10:13:24,082 [ 829809] WARN - #com.android.ddmlib - Unable to obtain result of 'adb version'
2016-05-23 10:13:24,083 [ 829810] INFO - ditor.DeployTargetPickerDialog - Unable to obtain debug bridge
java.lang.RuntimeException: Unable to create Debug Bridge: Unable to start adb server: Unable to obtain result of 'adb version'
at com.android.tools.idea.ddms.adb.AdbService$1.run(AdbService.java:236)
at com.intellij.openapi.application.impl.ApplicationImpl$8.run(ApplicationImpl.java:366)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
at org.jetbrains.ide.PooledThreadExecutor$1$1.run(PooledThreadExecutor.java:55)
The really weird part is that I actually managed to get something working yesterday - but I don't know how. I started AS and received the same error, but then started Eclipse (Mars 2) and launched the Android Device Manager through Eclipse. As soon as I did I could launch my app through the AS emulator! I closed it all down and tried again, just to be sure and it worked again.
This morning I tried the same trick, but was told my SDK is missing. I checked and platform-tools was indeed missing (not sure why). So I installed it again, got the usual error, and now my trick with Eclipse is no longer working. I feel like I am in the Twilight Zone here.
The solution is very simple. Open 'Command Prompt' as 'Administrator', run adb kill-server, then adb start-server. It worked for me.
I probably should have done this as part of my initial troubleshooting, but I ended up disabling Windows Firewall and my anti-virus (Trend Micro). The firewall did nothing, but disabling Trend Micro completely solved the issue....
Somehow, for some reason, Trend Micro decided to start not liking the daemon being created by ADB. 4 days of tears and frustration over such a small thing. Hopefully this helps someone else one day avoid it.
Geez, I can't it's the TrendMicro antivirus !! ... many Thanks !
This also works for me on my 64bit Win 10, took me a day to reinstall AS and ADK and trying to figure out why ... adb kill-server, then try disable/enable Antivirus and you'll see the difference.
For finer-grain of control, add the bin\studio64.exe of AS into the Exception List of Trendmicro Antivirus and it'll bring up adb just fine.
I got this fix by following this link:
https://stackoverflow.com/a/38447003/5521389
going into GenyMotion settings -> ADB tab,
instead of Use Genymotion Android tools (default), I chose Use custom Android SDK Tools and then browsed to my installed SDK.
From the information you've provided, I'm not sure that what I'm about to type applies to your situation. But since no one else has answered, you might want to consider it.
I had a very strange situation in which I kept getting the 'Nothing to show' message even though I had defined multiple emulated types of Android equipment, and also had a physical Android device.
I tried all sorts of things to solve the problem without success. Then I eventually tracked down an adb.log file that had been created in a directory outside any of the usual directory trees managed by the Android tools; a directory that is usually used for temporary storage. The access permissions on the file had somehow been changed so that one of the programs involved in debugging, could no longer access the file, and so failed to start properly. Removing the file solved the problem. The next time I attempted to begin debugging, everything worked as it should.
Although I was working with Linux, if the Android tools work in a similar manner with Microsoft Windows, the file might be in a directory tree identified by an environment variable, either TMP or TEMP.
Just update your platform tools from the SDK manager and restart your editor
In the Task Manager, delete adb.exe
In terminal, run command adb start-server
This is quite a common question, but none of the solutions appear to work for me. First time asker, so apologies if I get the conventions wrong.
I am trying to connect my Galaxy S5 to my computer running Ubuntu 14.04 so I can do some android development. I have recently downloaded and installed Android Studio and the SDK and my device is detected when it's connected via USB but the device either appears as 'unauthorized' or 'offline'. I know I should be expecting the RSA key prompt but this never appears.
I have tried:
Checking debugging was enabled
Running adb kill-server and adb devices
Restarting (the device, developer options, the machine)
Simple unplugging and replugging the USB cable
Checking my adb version (it is 1.0.31)
Trying different USB ports
Revoking USB debugging authorizations
Toggling enabling ADB Integration from within Android Studio
Connecting as PTP device and MTP device
I have tried it on a separate machine that runs fedora and this works fine with no issues, the promopt appears right away. Therefore I imagine it is not the USB cable that is faulty.
Any ideas?
Try these:
Unplug and replug the USB cable.
If it still doesn't work, unplug the USB cable, disable then enable USB debugging in the device settings.
If the above two methods fail, reboot the device.
If rebooting the device also fails, reboot Android Studio too.
If reboot Android Studio still fail, try adb kill-server then adb start-server.
Try killing adb adb kill-serverthen disable usb debugging and then start adb by adb start-server then enable usb debugging and plug phone again and huh don't let phone sleep between process
EDIT
There turned out to be a problem with my laptop's ADB RSA key. I'm assuming my G3 was rejecting a bad key and disallowing my laptop to connect to it via ADB.
ADB saves a key file in one of multiple places on a Windows computer, the first is in the location where adb.exe is (C:\android), the second is in the user's >profile (C:\Users*username*.android), the third place is in the Windows system files (C:\Windows\System32\config\systemprofile.android), the file is >simply named "adbkey" with no extension. If there is no key file when ADB runs, it will generate one automatically.
Mine was located in my user folder (C:\Users*username*.android). All I had to do was delete the adbkey file (there was also a file named "adbkey.pub" which >I deleted as well), restart the adb server in command prompt (adb start-server) and plug my phone in. I instantly received the RSA Fingerprint Key window on my >G3 allowing connection between the two devices. Then typing "adb devices" returned my phone's serial number followed by "device" showing it was available. >I went back to the C:\Users*username*.android\ folder and sure enought there were new "adbkey" and "adbkey.pub" files.
got from XDA
EDIT 2
TRY this steps too
Navigate to where .android is stored
open .android and delete file named as adbkey and adbkey.pub
Start ADB then typeadb kill-serverand adb start-server
My fix to this issue:
Android settings
Developer options
Revoke USB debugging authorizations
Replug in device and accept authorization as usual.
Profit
Step 1: Turn off USB DEBUGGING in Developer Options
Step 2: Remove USB Cable
Step 3: Turn on USB Debugging(This rests USB Configurations)
Step 4: on Command Prompt enter adb kill-server and then adb start-server
Step 5: Connect the USB Cable
Step 6: Check Devices connected in Run in Android Studio(you should be able to see your device listed)
Step 7: If you want to continue running using the cable this would be good enough
(If you want to do Wireless Debugging continue with below step)
Step 8: type adb tcpip 5555. If no error is displayed remove USB Cable
Step 9: Look up IP Address of your phone from About abd then type adb connect xxx.vvv.b.n(your phone's IP)
Step 10: Check in Devices in Android Studio again and you shud see you r device in List of devices. If yes,
If you are on windows and you encountered the same problem, try killing the adb.exe process from task manager and then rerun your app.
Change the USB cable !!!!
I can't explain this technically, however after a lot of trial and error, this what have worked for me.
Could not get Samsung Note II (N7100) to connect.
Step 1. Follow answer from user4847410 above. Next time you connect your phone it will come up with an authorisation message and you're in.
Step 2. I also swapped my cable.
Step 3. Check USB port as if you install on one particular port then another port may not be ok for you.
Note: made two batch files
adb-fix.bat
adb kill server
adb start server
pause
adb-devices.bat
adb devices
pause
-- voted for that correct answer but I don't have enough kudos so it was removed! --
To fix this, use USB2 instead of USB3
A shorter cable did the trick.
It turns out that the wire thickness used inside the cable impacts on the resistance of the cable assembly – this resistance causes energy loss inside the cable when an attached load draws a current, and causes a voltage drop which can reduce the voltage to the end device to a point where it is not possible to charge quickly or completely.
http://goughlui.com/2014/10/01/usb-cable-resistance-why-your-phonetablet-might-be-charging-slow/
Change your USB Preferences to File Transfer if you use your smartphone to debug.
There are several option :
File Transfer /* Choose this one */
USB Tethering
MIDI
PTP
No Data Transfer
I had a long white cable. Just wouldnt stay connected. Switched to another, shorter, black cable and it works 100% of the time.
Disabling and Enabling the Developer options and debug mode on the Android phone settings fixed the issue.
Earlier for almost 3hrs I did:
I tried everything given in several sites and my android device never came online.
when I was running adb kill-server and then adb-startserver the "Device File Explorer" on the right bottom of the android studio showed "Device is not online (DISCONNECTED)".
Here is how solve this:
Revoked all USB debugging authorization on the device under "Develop options"
And I added sudo to command "sudo adb kill-server" and then " sudo adb start-server".
After this the message in "Device File Explorer" in android studio changed to "device is pending authentication please accept debugging session on the device". But no message appeared on the device. Tried stopping-restarting adb, connect reconnet usb cable, stop-start usb debugging but nothing worked.
Went back to device and changed the device usb settings from usb charging to "PTP", and, restarted the Android studio. And, boom, the message appeared on the phone to accept the debugging session on device.
use this command
-> adb disconnect
-> adb connect <ip address for your mobile:port number>
Eg : adb connect 192.168.2.58:5555
You can try this:
Go to tools/enable adb integration and uncheck it.
now check it and run again. Next time, android studio will restart adb and it may find your device.
Restart adb by issuing these commands in cmd
adb kill-server to kill existing adb session followed by adb start-server to start a new adb session
Disable and re-enable USB debugging on the phone and accept RSA fingerprints if asked by phone
Rebooting the phone if it still doesn't work.
If all above don't solve your problem, you may try delete environment variable named "ANDROID_SDK_HOME".
It really solved my problem. Hope it Help you!
This fixed for me
uncheck launch in tool windo
Source
https://github.com/google/android-emulator-m1-preview/issues/76#issuecomment-1023563846
This problem is because you have used an old adb version and not support on your device. or you have more than one adb
The key is:
make sure you have a latest adb executable on your SDK
Make sure to run adb command from "SDK_DIR/platform-tools/" because this should be the latest version (type command "which adb" to check) if u have more than one adb file, you can rename another one.
in my case, on my Windows 7 i have one more adb on "C:\Windows\adb.exe" and its an old version, so my adb command always run from that file. I fixed the problem by running adb form my sdk directory "SDK_DIR/platform-tools/adb.exe"
On windows--> Launch your terminal from the platform-tools folder inside android sdk.
Then use the following commands
adb kill server
adb start server
it should work
Try upgrade your Android SDK Platform as below steps:
Run the SDK Manager
Execute "Install packages…"
Restart the SDK Manager
I tried and it's ok for me.
ref: link
You maybe having an older version of the ADB, Update the tools package and that should bring down the latest ADB.
I also recently had this problem and I solved it by rebooting Android Studio. But my friend had to have the original cable for his device, no other cables worked.
In my case (same problem - that Nexus 5 is connected but with "offline" status) the problem was solved by "Invalidate caches and Restart" in Android Studio.
Suppose that problem was in adb and restarting Android Studio causes to adb restart.
Download and Install your device driver manually through visiting manufacturer website like :Samsung,micromax,intex etc.
In my case the problem was that I used a USB extension cable. As soon as I plug the microUSB cable right into the PC the device has detected.
In my case, turned out that you need to be logged as owner of device to properly accept the USB debugging.
Tried the "Disable and re-enable USB debugging on the phone" step but didn't get the RSA prompt on "normal" user, switched to owner and tried again and got it.
I had this issue on a device with USB-C using a microUSB cable with a USB-C adapter. After switching to a USB-C cable without any adapter it worked. I only saw this issue on a LeEco.
I tried most of the things on this page and none of them worked for my Samsung S5. However, when I switched the cable to a USB-C type the problem seemed to be solved...until next time.
Besides the solution mentioned above, try to download Samsung's Android USB Driver for your platform. Here is a link to the Windows one:
https://developer.samsung.com/galaxy/others/android-usb-driver-for-windows
If your app doesn't manipulate WiFi connections - another slightly different solution, which bypasses USB issues entirely - enabling a wireless debugging connection - ADB over WiFi/TCP/IP.
I'm new to Android programming. I was installing the Android studio and it got stuck at one point during installation showing the following message.
So, don't to how to proceed, I searched about it, but couldn't get explanation about this specific condition.
Can someone explain what to do next?
Screenshot:
Note: I'm using Windows 7, Installed JDK 7 before installing Android studio.
Update: I tried to click upon "Setup Proxy" and then just clicked ok without doing anything and it worked, don't know how, but it did.
Try that if any one face the same.
Add the following code to C:\Program Files\Android\Android Studio\bin\idea.properties
disable.android.first.run=true
Just open the file and press Ctrl+F and type run then you will find this run=false, change it to true.
1) click on set up proxy.
2) Select option Auto Detect proxy.
3) Click continue, it will work!!
All the best
I clicked Cancel at this screen and process of setup continued. I saw it on Linux after copying android studio folder from one PC to another. By the way, I started studio not connected to Internet cause I try to be able to work offline.
I just hit this same problem - I was on a VPN.
I tried setting a proxy with 'auto detect proxy settings' but it did not help.
Then I tried disconnecting from the VPN with no proxy set - this resolved the problem for me.
good luck.
You can set the right proxy to solve this problem.
Set proxy ->
Manule...
Https and port
Sometimes,if you use Shadowsocks on your macOS, maybe you will have the same problem.You can turn Shadowsocks off to deal with this problem.
I finally solved the problem by following the Steps:
Add the following code to "C:\Program Files\Android\Android Studio\bin\idea.properties"
Open idea.properties with notepad
Then, enter the code below anywhere on a new line in the file (see attached image)
Code :
disable.android.first.run=true
Save the file
Run the application
Clear your DNS if there is any dns server settings like google, comodo,
symantec etc.
Check your firewall settings if you are using tinywall, zonealarm etc.
If your computer and network connection doesn't have any dns settings and firewall; then check your internet connection maybe there is an update process to slowing down your internet speed. So if there is a process stop or wait for it. And try again. Good luck...
Yet another reason why this can happen is when your time and date settings are not synchronized correctly. I installed android studio inside a virtual machine linux guest that didn't properly synchronize the time with the windows host and as a consequence the above message occured even though my internet connection was working fine.