Android device monitor crashing -- possibly due to Eclipse - android

Here's an odd issue I can't seem to find any information on.
I'm working on an Android app with a friend who uses Eclipse -- I use Ant and the Android command-line tools. Sometimes when I checkout code that was written by him and the project.properties file gets pulled into my local workspace, I'll have to change the path to the libraries back to where they're at on my machine, as it gets automatically set for him via Eclipse. This may be of use to know in light of what just started happening when I try to launch 'monitor' as I've always done; I get this error dialog box that pops up and says: An error has occurred, please see the logfile: /home/user/.android/monitor-workspace/.metadata/.log
So I did. It was, after I'd tried to launch monitor several times to no avail, a really long logcat-like file of Java traces. I cleared them out, thinking that perhaps it had run over its own max size for internal monitor data, but that didn't stop it crashing. A new set of errors just gets appended.
This is the first time this has ever happened, and unlike essentially every other Android problem I've had, I can't seem to find any existing information on it. The device monitor now seems to want to be integrated into Eclipse. I don't use Eclipse so I'm not sure how the monitor runs within it, or whether I'm correct in assuming that some configuration file somewhere needs to have a line changed (or whatever).
Here's the content of the logfile:
http://pastebin.com/JitCWrGg
Could anyone lend a word of advice?
Many thanks!

Related

Ensure that the Eclipse LogCat displays items relevant to my application

When I run my Android application in Eclipse on my machine, it automatically sets up a LogCat filter for my application, and only shows lines that are relevant to it.
However, running the same application on another PC (which happens to have Eclipse 'Mars') running on it, it just has one filter saying 'All messages (no filters)'.
Is there a setting somewhere to turn this on?
And incidentally, I know that I can set up a filter manually, but I liked the functionality that I had before, so I just want to turn that back on.
Regardless of what IDE you use I would recommend you take a look at pidcat.
From the repo:
Colored logcat script which only shows log entries for a specific application package.
You do need a bash terminal.
I will also recommend you move your project over to Android Studio.

Debug Android system app?

I'm trying to create a (root) app in /system/app, but having an issue that I can't resolve without seeing some errors and debugging to see exactly where it's going wrong.
If I run from Eclipse, errors are expected however, as the app won't have appropriate permissions.
How can I run a local (/system/app) installation, and somehow see what's going wrong?
Can it be done from Eclipse? I had a look at this - but it's so poorly formatted I couldn't make sense of it. If it can't - is there some way to print errors as text?

Possible reasons/fixes for build error for Android Emulator

STEPS-TAKEN: Not sure what the source of the problem is, but the quick description of the bug is that:
I install all required software, SDKs, configs,
Then create two new projects each using the tabbed-window template, each of which support deployment to Android.
Then I run one project via Titanium Studio's Run option, let the Android Emulator load, and confirm it's the app is installed an working.
Then I closed the emulator, and then run the other project the same way as the last, though when the app is shown on the screen it has the name of the first app, not the app run.
FIXES-TRIED: I've attempt executing "Project >> Clean" for all projects before the second run, and still get the same "bug".
SETUP: To my knowledge all of my configs are correct, and clearly the build "works" though it is very possible there is something wrong with my installation build chain to get to the point I'm running the app in Titanium Studio via the Android Emulator.
ERRORS: I've reviewed the console output for FastDev, AppInstall, Android-Emulator, etc and have seen no error messages that jump out; meaning I have seen no error messages, except for build.py error after the first script runs saying it didn't find the script running on a port when it attempt to kill it; given the request is to kill itself, and it's not found, I just assume this is a confusing way of saying the script did what it was suppose to do.
Current build: is on Windows-XP-SP3 using TiStudio 2.0.1 build, JavaSDK 1.6, r18-Android, and Android-2.2
Recent emulators have persistent state, so your second launch probably gets back the system you were running before.
You should not have to resort to this on a regular basis unless something is broken in the workflow, but deleting the AVD and making a new one should get you a clean slate.
I believe there is also a startup flag to the emulator which tells it not to use the checkpoint from a previous run, but start from scratch - you could try to change your configuration to use that flag.
A downside to either deleting or forgoing checkpoints is that the emulator will take longer to start up.
Really though, you are supposed to be able to re-install or launch a given application, or install a completely different one, all within the same running of an emulator. You aren't supposed to need a new emulator, any more than you need to go buy a new device (or perform a factory reset on it). So something is not right in the setup, and the best solution for long term productivity is to identify and fix that. Short term of course, you might need to wipe the slate clean if that helps you meet today's deadline.

Android Apps wont update

i know that eclipse has a couple of glitches when it comes to updating your app and running it on the emulator, i have tried everything that i have found on the internet. Stopping the adb manually making a new emulator and starting it with "wipe user data" and restarting it even reinstalling all of the programs. What i have noticed is that it updates correctly until i start adding images to the drawable folder. After that it doesn't update at all. Can anybody help me its really frustrating also the pictures show up on the "graphic layout how they are suppose to it just doesn't update.
When you add images/resources to the project Eclipse sometimes (always?) doesn't realize anything changed. So then when you run the project, you are just running the last version.
A simple way around that is to change one character of code, change it back, and then run your project forcing Eclipse to recompile and upload the new project with the new resources to the device/emulator.
Do you use 9-patch images? If yes - they should be valid. Once I added an invalid 9-patch image and as a result my Eclipse failed to build the app while it had not informed me what was wrong, so I spent some long time figuring out what it could be.
Another idea - image file name should only consist of a-zA-Z_ chars. Yes, commonly used '-' (minus) char is not allowed.

Android - Having a hard time debuging Eclipse

I am a little bit new to developing for Android using Eclipse (Coming from a .NET/Visual Studio background).
My biggest problem in developing Android app is "debugging" them. Every time the emulator throws an error, there is no message, no explanation of what caused the error. I basically have to keep doing trial/error until something works.
My question is: Is there a better way to analyze the error messages that emulator shows (basically some stack trace about Dalvik)!
Also, is it possible in Eclipse [when debugging] to move the debugging cursor backwards to re-evaluate a variable or "skip" some lines of code?
Use LogCat view to see error/debugging messages. Regular console is of very limited help. Window->Show View->Other->Android->LogCat There on the top you will see some round buttons that basically can filter log from V (verbose) to E (error). You can't copy/paste from theLogCat window but you can save selected output to text file
Regarding the error messages (I'm assuming these are the messages that show up in LogCat): I've found that analysing the error messages and working your way up the list until you reach code that is yours is the most effective way to work. Frequently (for me at least) the emulator will crash and break somewhere in the OS code (which you probably don't have the source for) but you can follow the LogCat messages back to your code and start to see where the problem is. The crash may appear to happen in the OS code, but the original cause is typically you passing something wrong to the OS.
Regarding going backwards in code: nope, at least not with the my Eclipse Ganymede install
Regarding skipping code: When your in debug mode under the Run menu you can select "Step Over" (skips going into a method) , "Step Return" to exit a method and "Run to Line" in addition to setting Breakpoints by right clicking. This causes the code to run, but you aren't single stepping through it. Otherwise the only way to "skip" lines of code is to comment it out. I believe you can also change the value of variables in the debugger, but I've never tried personally. This may give you the desired effect.
Try closing all unrelated project, switch off eclipse and then do a clean and build for the project in picture.

Categories

Resources