Changing Android SDK Versions in Eclipse mid-development

First of all, let me say that you should definitely avoid being in a position to need this guide if at all possible. I would highly reccomend ignoring anything that tells you to use a version older than that absolute newest one possible, because you’ll probably end up doing a lot of work to fix it later. Should you end up in this unfortunate circumstance like I did, here is how you change your SDK version in Eclipse the ugly “I don’t actually know how to fix this but I can hack it” way:

1) Create a new project (you can’t name it the same as your old one, name it something similar). This time use the new SDK version.

2) Delete the following files out of your new project, and copy-paste the ones from your old project in their place: all src->’your.package.name’ files, all res->layout and res->value files, and finally, your Android manifest. Note that you may want to double check your Android manifest to see that the min SDK version variable updates itself. It did so for Daniel, but it may not for everyone.

3) Right click your old project, Refactor->Rename to old[ProjectName]. Right click your new project, Refactor->Rename to [ProjectName].

4) (Optional) if you’re using subclipse, it is now mad at you. You will still have a connection between your repository and what is new old[ProjectName]. To correct this, just do a commit of the newly made [ProjectName] directory, by going through all the steps associated with that. (Right-click, Team->Share Project, set up repository info, write commit comment etc). It will warn you that it needs to check out the most recent version, this should be fine since you likely have the most recent anyway, it does some magic and you get your pretty black asterisk back. Hurray!

Note that I am 100% sure all of this hackery is completely unncessary and that Eclipse has in it some magical function which would’ve just upgraded the SDK cleanly. However, I spent about an hour looking for said magic button and didn’t find it. In a pinch, you can use my foolish method to change your Android SDK version over!