Search code examples
javaandroideclipse-adt

Error in my R.java file cannot be resolved


I am using the Eclipse ADT bundle and recently updated my Android SDK tools and Android SDK platform tools then thereafter I tried creating a new project and I keep getting an error in my R.java file that seems trivial but I still dont understand how it keeps showing up since it is an autogenerated file.
The error is:
Syntax error, insert "}" to complete ClassBody.

Keep in mind this is when I have just created the project. Also deleting the file and letting it autogenerate still yields the same result that is the error.
Please help on how I can solve this,can't seem to find any links to a newer ADT bundle.
This error shows up in the console:

ERROR: In MenuView, unable to find attribute android:preserveIconSpacing


Solution

  • This problem occurs when you update the ADT. So it is recommendable to use Android Studio.
    If that doesnt work then try what @Harsh Dattani stated in the previous answer which is to Clean or Rebuild the project.