The problem sometimes occurs when there are errors in the project.
For instance, if your project is configured with a target of 3.2 but the 3.2 libraries are not available, you will not be able to change the version to 4.0!
The usual (perhaps brutal) solution I use is to create a new project with the correct target and copy src, res and manifest into the new project.
Update:
This seems to work:
I always run Android Tools | Fix Project Properties after making any changes to the build target.