Sunday, May 17, 2009

Android: "ant install" complains about INSTALL_FAILED_ALREADY_EXISTS

The android docs about writing apps without eclipse say to run "ant install" to upload an app to the emulator that's currently running. What they don't tell you is that after you've tweaked your code and recompiled, running "ant install" again will complain that the application is already installed. You could use the virtual phone's Settings... Applications... Manage Applications... [click on your app]... Uninstall each time, but that sucks. There appears to be an "ant uninstall" command, but that doesn't actually remove the app on my emulator.

What they should have mentioned is that you can merely run "ant reinstall".

(The other thing the docs suck at is making it clear what classes are in what versions of the API. So for example, android.text.format.Time wasn't found when I picked --target 1 (the original API), and I had to start a new "hello, world" app with --target 3 before it'd work. Very frustrating for a new android developer).

1 comment:

Matt Kanninen said...

You're a top google search for INSTALL_FAILED_ALREADY_EXISTS . I was really hoping ADB would let me test installing my application over a previous version, a common user behavior, and something eclipse does without issue.