android Eclipse logcat error: device() request rejected - device not found - android

I am having trouble getting my somewhat new Thunderbolt to print to logcat in eclipse...when I plug it in, I get the following error in the console:
[2011-08-04 11:23:10 - DeviceMonitor]Failed to start monitoring
[2011-08-04 11:23:11 - Logcat]device () request rejected: device not found
java.io.IOException: device () request rejected: device not found
at com.android.ddmlib.AdbHelper.setDevice(Unknown Source)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(Unknown Source)
at com.android.ddmlib.Device.executeShellCommand(Unknown Source)
at com.android.ddmuilib.logcat.LogPanel$3.run(Unknown Source)
I can run adb just fine, and sometimes when I totally restart my computer logcat will work for a while, but it usually doesn't. Makes it hard to debug!
Anyone have any ideas?

Try typing the following using adb (either from the adb.exe directory or after adding adb to your environment variables):
adb kill-server
adb start-server
See if this works.
EDIT:
It looks like the device is not installed on your system.
This means you need to install the manufacturer's device drivers.
The entire list can be found here.
The driver for your Thunderbolt can be found here.
Install these and restart your computer if needed, and give it a try again.

Related

"Error connecting to the service protocol: failed to connect to http://..." after running adb reverse command

I have a flutter app that I debug on real device, and it runs fine in the debug mode.
I got to a point when I created a backend server that runs in a localhost:8080 only machine, so in order to make it accessible from my real phone device also, I ran:
adb reverse tcp:8080 tcp:8080
and it worked exactly as I expected where the app was running.
But, after this, if I re-rerun the app again in the real device ( unplug and plug again the USB in the machine ), it got to the point of showing the √ Built build\app\outputs\flutter-apk\app-debug.apk. and this error got thrown and it terminate/close the debug process of the app :
Error connecting to the service protocol: failed to connect to http://127.0.0.1:61410/DHX5GEb2kn4=/
I did try to kill the adb.exe command with:
adb kill-server
supposing that this will undo the adb reverse command but the same error gets thrown
well, I found a painful fix, which is restarting the device, but this takes much time and is painful.
I want to know what should I turn on/off while debugging my flutter app
I finally managed to fic the issue, and get my app debugging properly again.
What I did wrong ?
When I needed the adb, I thought it's not installed on my laptop since when I runned adb command in command line tool (cmd), it tells me that it's not recognized, so the smart me did downloaded the android platforms-tools separatly from Here
, and I runned the :
adb reverse tcp:8080 tcp:8080
from it's folder, which runned, and I thought I solved the issue, but what I just learned is that the Dart VM server uses an internal installed another adb.exe which have a different version (39) that what I run the command with (41).
so when I re-debug the flutter project, the error happens.
How did I fix it?
I did simply searched for the internal adb.exe, you can find in the Android folder, ...\Android\SDK\platforms\tools\adb.exe.
I Paste the new adb.exe with the height version inside the folder.
Run the command from that folder
For 3., you can set the path of that folder in the PATH in environment variables, so you can run the adb commands from anywhere.

I/O Error Connection refused android studio

WhenI run a project in android studio, I get this error - I/O Error: Connection refused
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
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) :
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.
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 !
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
If still not working you can try :
Start a emulator ( with your AVD manager)
when finished loading, Open DDMS panel (in android studio : Menu Tools > Android > Monitors DDMS)
Look if you see your current running android emulator ( listed on the Device panel)
See if this line is kind of "flashing" ( connect/disconnect).
If so, you have probably a other adb instance running in conflict
If not, you can restart adb or reinstall your SDK
Hope this could help someone !
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.
If you are using a real device :
Just reconnect your device, make sure your cable are workable and you installed the proper drivers.
I had the same problem, and my problem fixed by restarting the android-studio. Hope, that will help you too.
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 }
Then re-make/rebuild the application and debug/run worked

ADB commandline Hanging during install (PhoneGap)

My Phonegap app refuses to load onto my Android device (even the HellowWorld default app is refusing to load)
Everything was running just great until today.
Here's my console log:
***\>adb devices
List of devices attached
4c05609b device
***\>phonegap run --device -V android
[phonegap] detecting Android SDK environment...
[phonegap] using the local environment
[phonegap] compiling Android...
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Compiling app on platform "android" via command "cmd" /c ***\platforms\android\cordova\build
[phonegap] Platform "android" compiled successfully.
[phonegap] successfully compiled Android app
[phonegap] installing app onto device
[phonegap] Generating config.xml from defaults for platform "android"
[phonegap] Running app on platform "android" via command "cmd" /c ***\platforms\android\cordova\run --device
It just sits there saying running... forever.
I have another terminal window open with adb logcat running and at some point (maybe 10-15 seconds into that last line getting printed) it stops logging. Termination of the process and subsequent calls to adb logcat result in more hanging (no logging at all)
So then I have to do a kill-server, start-server to break out of this endless hanging at which point the phonegap process terminates with:
[error] An error occurred while running the android project.
***\platforms\android\cordova\node_modules\q\q.js:126
throw e;
^
ERROR: Failed to launch application on device: ERROR: Failed to install apk to d
evice: Error executing "adb -s 4c05609b install -r "***\platforms\android\bin\Po
ached-debug-unaligned.apk"": protocol failure
I have tried::
deleting my .cordova folder in C:\Users\Name
running the adb install directly (without phonegap)
deploying to an emulator (same problem)
unplugging / replugging the device
rebooting all devices
toggling "developer mode" on the device and revoking USB debugging privileges
I am all out of ideas!
Would greatly appreciate any tips or leads.
ADB version 1.0.31
Galaxy S3 running Android v4.3
EDIT:
Deploying to an emulator claims to complete successfully, but the app never opens and does not appear in the app list inside the emulator. So I have no way of actually testing it on the emulator either.
Would really appreciate some assistance.
EDIT 2:
After some further tinkering I've discovered my issue can be more specifically described as ADB hangs (freezes) when I attempt to talk to my device. I've determined this because adb shell, adb install, and adb push all fail the same way as described above. No error, just finite waiting.
adb logcat, adb devices, and other read functions work perfectly fine until one of the aforementioned write functions hangs in which case I need to do a adb kill-server or TASKKILL to get adb logcat working again.
Not sure if this added information helps, but there you go. The last thing I haven't yet tried is to do a factory reset on my phone as suggested by this fellow. If I can't find a solution soon I will back up my data as best I can and attempt this...
Please save me before this becomes my last option!
In case this helps others I had a problem with similar symptoms. ADB install -r "apk path" would hang indefinitely.
I troubleshooted a myriad of things and identified that it was my USB cable length.
I have an USB extender cable as that I plug my devices into. The combined length of my device's cable and the USB extender cable caused this issue. Removing the extension cable fix the issue and eventually I replaced my USB extender cable with a shorter extension cable for the final solution.
The issues seems to resolve itself randomly. As others suggested, an arbitrary combination of ADB kill-server, restarting the device, and re-installing SDKs seems to alleviate the problem (even if only for a couple pushes).
I still have no idea what causes this hanging and, though superstitiously believe the arbitrary combination described above fixes it, am unsure how to permanently resolve it.
To future people reading this, until a solid explanation is given my only advice is to square away an hour or so to restart / rebuild your dev environment... and make sure you buy a durable stress ball.
Shot in the dark here, but some more things to try:
Are you on a work PC or something? Make sure you have USB write permissions. Also, try different USB ports and cables. You have the latest USB driver for your devices right?
Try updating the SDK tools. Or maybe something got corrupted and a re-install might do the trick.
You have free space on your devices right?
Unknown sources is checked on both devices?
What version of Android are you targeting?
Do try restart the device like other suggested. From my experience, kill the adb process, then run the cordova run command helps magically sometimes.
In my case adb seemed to hang, but in fact the data transfer from Mac to emulator was really slow:
$ adb push platforms/android/build/outputs/apk/android-debug.apk /data/local/tmp/
150 KB/s (15587200 bytes in 101.223s)
It's a lot faster on USB connected real device. Don't know why...
Had the same (original) issue (with cordova / testing on an old device) ie. hang during install.
Tried running adb install directly from cmd line ...
adb [-s <deviceID>] install <apk>
...and same issue so not cordova specific....
Opened android device monitor (ADM) ...
..sdk\tools>monitor
..and ran install from cmd line again and saw logcat message saying package was sdk 16 / device was 15...doh!
So went back to AndroidManifest.xml and changed android:minSdkVersion to 15 and all back to normal again - install worked fine.
( Issue arose because I had installed something else which had changed the minSdkVersion and then removed the something else and never reset the minSdkVersion )
So, possibly device sdk / android version is too low for your build. If not, a look at the ADM logcat output as you initiate the install from the command line might indicate what the issue is.
Unplugging and plugging device again usually helps.

Eclipse detecting the same device multiple times

I am facing a strange problem. The eclipse is deteting the same device multiple times and thus is unable to run the project showing error as :
Failed to install MetRoute.apk on device 'EC21BF384504FC4E': adb rejected install command with: more than one device
com.android.ddmlib.AdbCommandRejectedException: more than one device
Launch canceled!
See This image:
I tried to take help of this question but no help after following the process. Does anyone have any other solution.?
update : It is not needed to restart/close Eclipse
As told in comments by Ved Praksh, the solution is:
Exit Eclipse
End all adb processes from task manager as well.. Then:
In cmd, adb kill-server --> adb start-server --> adb devices
Then restart eclipse.
Most probably it will show only one device this time.
In windows start task manager >>> Processes Tab >>> Right click adb.exe*32 >>> End Process and Press End Process on the dialog box.
Try
./adb kill-server
./adb start-server
./adb devices (This should show your device exactly once)
and it should work.
And also restart Eclipse after this.
Reset adb in eclipse,If the problem persists it may be caused due to some hardware related issues with the usb port or your cable.
try using another cable/port/device and check whether the issue is solved.

Failed to install myapp.apk on device 'emulator-5554'

I'm trying to run an android app but it's throwing these three lines in red.
[2012-07-08 20:39:23 - myapp] Failed to install myapp.apk on device 'emulator-5554': An attempt was made to access a socket in a way forbidden by its access permissions
[2012-07-08 20:39:23 - myapp] java.io.IOException: An attempt was made to access a socket in a way forbidden by its access permissions
[2012-07-08 20:39:23 - myapp] Launch canceled!
I've put the tools and plateform folder into enviormental variable and also tried every possible thing which can be done but nothing change.
I've tried it installing manually and its says by "adb install myapp.apk"
and I get
protocol error
rm failed for /data/local/tmp/myapp.apk, No such file or directory
Edited:
I can't install anything using SDK Manager I m getting
Fetching URL: http://developer.sonymobile.com/edk/android/repository.xml
Permission denied: recv failed
Done. Nothing was installed.
kindly help me to resolve it
thanks
Try window->show view->devices->view menu->Reset adb and again run application.
Two primary reasons for ADB's protocol error are:
Zombie ADB process (e.g. adb.exe in Windows's task-manager or just adb in Linux ps -aux)
Default ADB port (e.g. 5037, 5554, 5555 etc) being occupied by some other process(es).
For both of these issues, the easiest solution is to kill the zombie or the port-blocking process. I explained the steps for both Windows and Linux here: adb kill-server not responding?
You may also try launching ADB with a non-default port. The steps are explained here: Changing default port (i.e. 5037) on which adb server runs
On Windows, I started getting this issue out of nowhere and was driving me nuts. I am happy that I could find the root of the issue. Hope this helps you too. Cheers!
Was having the same issue, turns out was simply because I was using a USB extension cable.
Removing that fixed it.

Categories

Resources