I had the same problem. I tried to solve with
sample.xml layout file -> Right click on it -> Open With -> Android Layout Editor
But no luck. Then I tried in a different way
Select “Project” (for example, “My Project”) from the “Package Explorer”
Right click on Myproject
Select Properties from the popup.
Choose the Java build path from the left pane
Select a source from the right tab
Choose Myproject / gen
Click the delete button
Repeat steps 6 and 7 for Myproject / src
Click OK
Click Add Folder.
Add Myproject / gen and Myproject / src
Ok again ok
He solved the problem.
Rafiq source share