Android: Eclipse doesn't pushed new version of

2019-08-02 15:46发布

问题:

When developing for Android in Eclipse, the emulator relaunches the old version of the app each time I run the project unless I go through the rather arduous procedure of Settings -> Applications -> Manage applications -> [my application] -> Uninstall -> Ok -> Ok in the emulator.

I had this problem on some projects but not on others when following the tutorials on the Android Developers site, and my friend turns out to have the same problem. Although this has been asked before (here and to some extent here) their problem turned out to be "some extra quotes on one of the xml file" and I can see no such thing in my project. Otherwise people seems to be saying that Eclipse should push the new version. Unfortunately, it doesn't.

I would be grateful for any suggestions.

回答1:

I had this issue as well, and what i figured out was:

If you are using your device for debugging, then you should launch a debug session, not a run one.

On the other hand, if you want to install an application, or you want to launch a run session directly on your device, the version of your application set in the androidManifest.xml must be greater than the one on your phone.



回答2:

  1. Try Menu-Project-Clean, Select your project to clean, this will delete everything but the source. Eclipse should re-build automagically if not select Menu-Project-Build Automatically.
  2. Right click your project, Android tools, fix project should automatically fix some unknown error maybe
  3. Double check your xml, an error in a layout could cause your situation. A wrong id for example will not show as an error in eclipse.