开发者

Android Emulator Debugging, Code will not Update

I'm having a troubling problem testing some code for and Android app. My app has two parts, and activity where the user changes some settings, and a broadcast receiver that responds to SMS messages, both in the same package.

Here's the problem, I first implemented some simple code to test out the broadcast receiver and the activity, and both worked fine. But then as I tried to refine the code, I noticed the emulator wasn't picking up any of my changes. E开发者_运维知识库vent went so far as to uninstall the app from the emulator and try again, no luck. Then I added some extra Toast popups to my receiver, nothing, still running the old code. I know its running the old code because its sending out an SMS using a string constant that is no longer in the current code, so it should be impossible that it respond with that value.

Here's the kicker that has me confused. For fun I made a change to my activity. Ran the project from Eclipse and that change showed up! Tried to test the receiver code again, runs the old code that doesn't even exist anymore!!

How in the world can half the package update, and the other half not? Can anyone help me out 'cause I'm about ready to lose my mind.


I had a similar problem. Changes made to classes imported from another project didn't get picked up by eclipse, but those made to classes in the current android project were.

Making a change to the current android project (inserting a blank line and deleting it) seemed to make eclipse pick up all the changes made and upload the app to the emulator.


I had this problem too, Now I found a working solution. Just follow these steps:

  1. Run your project normally.
  2. When emulator started, run your project again (DO NOT close the first emulator)

Then the updated application will be uploaded into emulator


I can't really be sure what happened but creating an new emulator image appeared to solve the issue.


I don't know why it happens but it's a problem I have all the time. What I typically do is

  1. Close the emulator
  2. Close Eclipse
  3. Reopen Eclipse
  4. Clean the projects (in Eclipse, select Project -> Clean... -> Clean all projects)
  5. Rerun the emulator

Annoying as hell but seems to work for me.


I'm having this problem too. It mostly happens when errors are entered into the code. The strange thing is if I go back to the original code, Eclipse doesn't revert to the original code. One thing that seems to help is to temporary delete the contents of a file, save, and rebuild, and then enter the contents back into the file, save, and rebuild.

How is one supposed to debug in such an environment?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜