appcompat_v7 errors after updates to API level 21 Material Theme


After updating to Android SDK level 21 I got the following error messages on Console related to Material Design resources,

[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
[2014-11-03 11:30:25 - AndroidApp] appcompat_v7/res/values-v21/styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.

If you look into appcompat_v7 -> res folder you would see errors in folders,

values-v11, values-v14, values-v17 and values-v21 folders : styles_base_text.xml, styles_base.xml, themes_base.xml files

To resolve this issue,

  1. Right Click on appcompat_v7 library and select Properties
  2. Now, Click on Android Option,
  3. Set Project Build Path as Android 5.0 (API level 21)
  4. Apply Changes.
  5. Now go to project.properties file under appcompat_v7 library,
  6. Set the project target as : target=android-21
  7. Now Clean + Build appcompat_v7 library and your projects

All errors including R Class is not found exception must go and things would be all set to get started again :)