Example code:
setContentView(R.layout.main);
Error:
R cannot be resolved
There\'s this error in all the class
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.