Example code:
setContentView(R.layout.main);
Error:
R cannot be resolved
There\'s this error in all the class
Check if your R is generated properly inside the "gen" folder.Check if there are any libraries missing which are added as dependencies from project properties. Also make sure that there are no issues which is preventing the app from generating R file. Go to Window > Show view> Problems and it will show you whats missing.
Please do the following:
1.Check whether there are errors in your xml file.
2.Try to clean the project and run it.
If you already updated the SDK tools, re-open the SDK manager and check under the "Tools" section that "Android SDK Build tools" are installed and eventually, update them. That made the trick for me yesterday.
Yesterday, I made an update with sdk manager, and I had the same problem as you. I fixed the issue: I have updated another time the android sdk (with the sdk manager tool), then I check update from eclipse for install the updated ADT plugin and I rebuid my project. "Android sdk Build-tools" from Android sdk manager is now rev 17 and now it is OK. I think the issue is from adt plugin from eclipse
1) Delete your Gen folder (It will be automatically created afterwards).
2) Clean you project.
See the miracle. :)