"DeviceMonitor]Sending jdwp tracking request failed!" in Eclipse / Android - android

I'm a noob learning Eclipse and Android. Whenever I close the emulator I get "DeviceMonitor]Sending jdwp tracking request failed!" in the Console tab. Infact that seems to be the ONLY thing I get in the console tab - I don't get all the emulator loading messages and other things I used to see.
Everything else seems to work, I can build, run in the emulator, debug in the emulator (via Run>Debug after setting a Debug configuration . . . I can't get "Debug As" to work, see: "Debug As..." in Eclipse for Android - don't know if that's relevant to this problem).
What does this message mean, and how do I correct it? Thanks in advance!

The message you receive is in the normal console of Eclipse and isn't really important, because it just reports you that the connection to the emulator was lost. That ok as you described you closed it.
The normal android log is only visible via the adb tool (via console) or with the view in Eclipse called LogCat. You can add that to your working screen if you go to Window -> View -> Other -> Android -> LogCat
I recommend to look at the other views of the android tools, too. Like Device or Explorer.
What might happen with the LogCat output is that it went blank. Than you need to clear the LogCat (there is a button for that on the top of the view) and if this doesn't help try to click on the emulator in the device list. If nothing of that helped: close eclipse and the emulator and start them again.

I fixed by changing the usb cable which was connected to PC and device.
Before that restarting dev machine, eclipse, even the device dint help.

Close eclipse, stop adb process. From command line, "adb kill-server".
Launch your eclipse project.

I don't know if this will help for sure, but I had a similar problem and I solved it by changing my workspace to a different folder where I placed copies of the projects and changed the names of the folders just one caracter so that It would not tell me they are already in use. Then I worked I just had to import the projects again and I refactored their names to match the code (just the project names).

This error is mostly result of incorrect permissions set for "ddms"/ "android" scrips residing in "your sdk location"/tools.
If you are getting only
Sending tracking request failed!
error then change the permissions assigned to tools/android.
To do that open the directory "your sdk location"/tools/ using file browser. You should see a file named android, right click-> properties -> permissions tab -> select allow executing and program. [chmod].
If your error is
Sending jdwp tracking request failed!
then you need to apply same procedure described above for "your sdk location/tools/ddms"

Related

How to fix "App not installed" - Xamarin app distribution

I used Microsoft's "Preparing an Application for Release" and "Signing the Android Application Package" tutorials in order to run an APK of an app I built on my Samsung Galaxy S8 phone.
When I try to run the APK, I am getting a message "Do you want to install an update to this existing application?...", and when tap "install", it shows an "installing" screen, and after couple of seconds I am getting a message "App not installed".
I have done these steps couple of times, each time I got the same result.
Did it happen to anyone?
Is there a way to know for 100% what causes this problem? There is not error code and it leaves me hanging.
I would like to thank #Blu and #Cheesebaron for their guidance.
OK, so after trying to understand where my error was (a lot of ctrl+f's), I had:
"failure copying native libraries error code=-113".
This means I had to my app.Android in Solution Explorer -> Properties -> Android Options -> Advanced -> unchecked all except the last one, then unchecked it, and it checked right back what was needed for it to work.
Then it didn't work AGAIN.
So I looked up again in logcat (after trying to install again, so that I will see the new error), and I found this:
"signatures do not match previously installed version; ignoring!".
I went to Settings -> Apps -> searched my app by its name -> Uninstalled.
Then I tried installing again, and it worked!
BTW, for the sake of other people - How to use logcat? (generally! you may experience some issues, google it and you'll do fine):
Connect your phone to your computer.
go into: c:\Users\YOURUSERNAME\AppData\Local\Android\Sdk\platform-tools
type "adb logcat".

How to debug a cordova plugin for Android

Hi I have created a cordova plugin for Android. But it is not functioning properly.
I want to debug it an IDE.
How can I debug the cordova android plugin file when I launch the application in my mobile?
What are the different and easiest ways to do it?
Thanks in advance.
Expanding response of laughingpine, i use this method:
Debug javascript part with chrome + dev tools + genymotion. You can access it from "inspect devices" and you can debug javascript part.
The problem is for debug my own plugins. For this, i build project "cordova build" from console, and import into Android studio the content of platforms\android from project folders.
After repair some errors whit gradle, i can run and debug whit android studio + genymotion, to acces the .java files.
Build your Android app (via cordova build android) and install the app in your device. For instance, I installed Dropbox on computer and device and transferred the files between them with that free service.
Plug the device into the computer with your USB plug.
Set up the device to enable debugging. In device, Settings:
Allow USB Debugging
Select debug app
In console, type to following so we can read all the messages in full:
adb logcat -v long
If you want to output all the messages to a text file on your Mac desktop (it’s different for a PC), type:
adb logcat > ~/Desktop/logcat.txt
Immediately the console should be outputting a lot of lines of text. If it stops at
-waiting for device -
and freezes, then check your screen to see if there is a popup to answer. If there is none, then unplug the USB from the device and try again. In my Settings > Developer Options, I chose “Select debug app,” then chose the app I installed; that might help too.
When the reporting stops, sometimes I hit Return a few times to mark the place with a large gap of space before doing the next step. This tells me how far to back up.
Tap on app icon in device to start it.
Read the output in logcat.
Tap Ctrl+C to stop logcat.
I think the best way to do this would be with logcat. Logcat is also built into Android Studio, so you can use that IDE to help you debug.
If you are running logcat from the command line, you can limit to a certain tag using the following: adb logcat -s "YOURTAG"
If you are running via Android Studio, see this documentation.. You are able to attach the debugger to a running process, so if you didn't do up your application in Android Studio, you can still attach the Android studio debugger to it. This is done by selecting Attach debugger to Android proccess. Again see the documentation for more.
Android Studio also can also filter based on tag name, log type, etc. This is done by expanding the filters menu, and adding a filter (filter by type, tagname, regex are accepted.)
Lastly, actually getting your plugin to spit out valuable information. First import the Log class: import android.util.Log; and setup a TAG private static final String TAG = "MYTAGNAME". Whenever you wish to write to the log (in this example, the debug level), call Log.d(TAG, "Your message to debug");
See the log documentation for more.
Personally I was right at home using logcat from the command line, but Android Studio does offer a slick interface for debugging your plugins.

Android Logcat is empty when debug with device in android studio

When I try to debug using android device in android studio Logcat shows nothing. But when I use emulator LogCat shows all the messages. How should view the Logcat messages when debugging on actual device?
Thank You !
In Android studio 0.8.0 you should enable ADB integration through Tools -> Android, before run your app. Then the log cat will work correctly. Notice that if you make ADB integration disabled while your app is running and again make it enable, then the log cat dosen't show anything unless you rebuild your project.
Restart the phone. And it solves magically
I was using Lenovo A7000plus powered by Android 6.0 M and found out that my Android Studio was unable to record the debug process, but somehow other's phone debug report could be recorded. Plus, I tried use Memu emulator and it recorded normally.
Strangely, that device was recognized by Android Studio and ready to be debugged, but no recorded debug report at all from all application that ran on the device. Of course, USB debug was tuned on.
What I did before, I turned off Developer option on that phone in order to play my favourite mobile game (F/GO) which forbids USB Debugging is turned on in the device.
A few hours later, after trying any method in Internet and not success, accidentally I found simple but strange solution that is Restart the phone. I restarted the phone while it was connecting to PC, and somehow the logcat showed all debug process in Logcat like normal.
It sounds like non-engineering solution at all, but that's really work for my case.
As of 0.4.0 I have noticed that the logcat tab does not work in the debugger window - only in the Android DDMS window (hit Alt+6 to bring up the working logcat while debugging). Awkward I know :)
In Android studio 1.0.2 or later: you should enable ADB integration through Tools -> Android, before run your app
In Android studio 1.* if logcat messages have disappeared for me helps the next trick:
Tools -> Android -> disable )) "enable ADB integration" (if it've been enabled)
Tools -> Android -> enable it again "enable ADB integration"
In 0.8.2 the DDMS window doesn't show up. However restarting the adb logcat windows by pressing Alt+6 (Twice, if it's already opened) fixes the issue. It worked for me.
I understand that this question is over 2 years old, but from my searches a few people are still having a persistent problem with this. One possible solution to this (which worked for me after two hours!) is that your phone settings may have its "Log Switch" set to off, hence it isn't sending your log data to the IDE.
Here is the solution - "Unable to open log device '/dev/log/main': No such file or directory"
Hope it helps!
If anyone's still having trouble with this despite trying all the answers here, just use System.out.println instead of log.* and your debug messages will output.
Updated: I finally got the cause of the problem in my case. If I switch of my device's wifi, the log shows. Otherwise, the log will not show. I tried several times and it the always show full logs when I turn off my wifi.
My device is: Gsmart Classic, OS: Android OS, v5.1 (Lollipop). I met the problem when I updated the gradle build tool from 'com.android.tools.build:gradle:2.0.0-alpha1' to 'com.android.tools.build:gradle:2.0.0-alpha3' in Android Studio 2.0-preview. After trying all the solutions with no luck, I tried un applied all the instant run choices and re-apply it again. Then the logs show up.
Note: if it still doesn't help. You can as well try to switch back-and-forth the back ground process limit. Unfortunately, I couldn't reproduce the error.
In Android Studio 2.x I used to have to restart to get it working but often switching back and forth between the applications works or running
adb kill-server;
adb start-server;
to restart adb fixes many things as well.
The problem seems to have different causes.
For me, the issue was that I had two emulators with the same name (I created it, deleted it, and then created it again with the same name). There were two emulator entries in the logcat dropdown and it was connected to the wrong one. All I had to do was switch to the other one. I prevented the problem permanently by renaming the emulator.
I believe that the problem has various causes for different users. I experienced the same issue with logcat not displaying any information when my application crashed, and we all know how frustrating this can be.
The following are the solutions that worked for me.
Invalidating caches and restarting android studio
In the developer option in your physical device make sure the logger Buffer size is set to 1MB per logger buffer.
Restart your physical device.
Hope this helps.

LogCat & Console stopped working with Eclipse Android Emulator

The Console and LogCat printouts stopped working in Eclipse with the Android Emulator.
I'm getting the following Exception in the Console
[2011-11-10 11:04:58 - Unexpected error while launching logcat. Try reselecting the device.]device not found
com.android.ddmlib.AdbCommandRejectedException: device not found
at com.android.ddmlib.AdbHelper.setDevice(AdbHelper.java:736)
at com.android.ddmlib.AdbHelper.executeRemoteCommand(AdbHelper.java:373)
at com.android.ddmlib.Device.executeShellCommand(Device.java:319)
at com.android.ddmuilib.logcat.LogCatReceiver$1.run(LogCatReceiver.java:100)
at java.lang.Thread.run(Unknown Source)
Usually when the emulator is loading or updating an apk there's a printout in the Console telling the status. Now the Console is just blank.
I made sure the emulator is selected in the DDMS Tab.
I tried deleting and recreating the emulator in the AVD Manager. I restarted eclipse and the computer. I also updated all of the android and eclipse software in hope that the problem may get fixed. But, to no avail.
It may be related to a problem I had in my code yesterday. There was an unending loop in my code, so I had to stop the emulator mid code running.
I was having a similar error and it was driving me crazy. I just got it to work by doing the following steps:
In a shell or command prompt run: adb kill-server
Unplug the USB cable from the device and plug it back in.
Open the devices view (Window -> Show View -> Other -> Android -> Devices)
Click on the device on the android devices view.
I tested this for the emulator and it works if you relaunch the emulator instead of step 2.
Another way I got it to work was to restart Eclipse. But that's not usually ideal.
Note: Logcat would stop working any time I disconnected the usb cable from my android device (similar to killing an emulator).
I recognize this might not fix your initial issue, but it might help others who stumble on this question.
I also had the same problem, install the SDK even three times as TT, but the solution is to go to the folder android-sdk-windows, then platform-tools, and double click adb and ready!
Clean project with Project/Clean...
deleting the emulator and creating a new one did the job for me.
Even in my case a faulty code or a secret infinite loop, i think is the problem. i tried out something and logcat failed to boot up since then.
Most likely you have 2 instances of Eclipse running (I did).
(On Windows) Exit eclipse then check with the Task Manager if there is another eclipse.
End it as well as any image name "adb".

IOException everytime I try to upload anything to android emulator

I'm using Windows 7 Ultimate 64 bit edition and Eclipse 3.5 with the Android plugin. Every time I create a new project and try to publish it, I get an error like this:
[2010-02-15 22:48:10 - EPG3]Uploading EPG3.apk onto device 'emulator-5554'
[2010-02-15 22:48:15 - EPG3]Failed to upload EPG3.apk on device 'emulator-5554'
[2010-02-15 22:48:15 - EPG3]java.io.IOException: Unable to upload file: timeout
[2010-02-15 22:48:15 - EPG3]Launch canceled!
The emulator is working perfectly, adb can see it, I can even logcat from it, but it can't push or pull anything from it. Nothing appears in logcat to suggest the emulator even received any command. It doesn't matter if I have the Firewall on or off, or if I try invoking adb install to bypass the plugin. Nothing works even with a blank app.
Any ideas?
Not sure if this helps but I had the same exception when I tried uploading a project to the device and fixed it by increasing the value of "adb connection time out (ms)"
PC: (eclipse -> window -> settings -> android -> ddms)
MAC: (eclipse -> preferences -> android -> ddms)
I was pretty pissed at myself that it took me so long to find the setting so I thought I'd share.
I just ran into this error. To resolve it, I deleted my .apk file and built the project again. Voila! Upload works now.
Isnt this a problem with resources loading? Tried all the hello examples without problems, now the first with drawables and now I/O problem as you had.
I think its the reason that in the example they speak of a drawable folder, but in my default project structur there are 3 drawable folders.
Keep on debugging ;)
I got this error about every 30-40 compilations. I don't how, but this solution work for me.
Go to bin/ folder and rename your EPG3-debug.apk file to EPG3.apk (if you are using debug mode) or EPG3-release.apk to EPG3.apk (in Run mode), return to Eclipse, now you can Debug/Run your application. This should "unchoke" this whole situation, so you can make changes in your code and next time Debug/Run program normally (until you get this error once again, then you must repeat this tip).
See this question — Windows 7 and Android don't seem to get on so well initially it seems: Failed to parse the output of 'adb version'?
Are you able to telnet to localhost 5037? That's where the adb server listens for incoming connections from adb clients.
Did you try to add the path of the tools directory to your system PATH as described here ?

Categories

Resources