I had the same issue, I did the following to fix the problem.
- Go to "Properties" of the project.
- Select "Java Build Path"
- Select "Order and Export" Tab
- You should see the selected project's "src" and "gen" paths and dependencies here.
- The order how they listed were first "src" and then "gen" path
- I switch them, so that "gen" folder is build before the "src"
gen - automated code in project (from dependencies and references)
src - source code in project
There was no need to restart the Eclipse. It just started working.
Honestly I have never tried "Android Tools > Fix Project Properties", sometimes it might be doing the same thing. I do not know, I just did above after seen the error message, thinking something is wrong with the build paths.
Edit
Later on it was not sufficient, I was getting the error again. Then I "checked" all the dependencies listed in that view. Now it works again. So far so good. I will keep this updated if it fails again.
FYI: in my last attempt, I tried "Android Tools > Fix Project Properties", but it didn't work out for me.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…