I got this error in an Android project in which I referenced anexternal JAR library.
I solved this by cleaning the project by navigating to Project->Clean and cleaning the project.