Manny265
Manny265

Reputation: 1709

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

Upvotes: 1

Views: 1259

Answers (4)

dong wei
dong wei

Reputation: 1

i think it's SDK Manager-Tools not installed.

Upvotes: 0

Manny265
Manny265

Reputation: 1709

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.

Upvotes: 0

Reflection
Reflection

Reputation: 397

i did comment "android:preserveIconSpacing" but generate more error. i have back up appcompat_v7 and replace it with broken one and every thing goes right again .

Upvotes: 0

Harsh Dattani
Harsh Dattani

Reputation: 2129

  1. Navigate to \Android.Support.v7.AppCompat\2x.x.x\content\support\v7\appcompat\res\values\attrs.xml in side your project directory.

    or

    open the AppCompat project in your workspace and navigate to \res\values\attrs.xml

  2. Find "android:preserveIconSpacing" in attrs.xml file and and comment that line.

  3. Rebuild the project again.

Hope this solves the issue.

Upvotes: 8

Related Questions