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 :)






Hello there!,

You are using AdBlocker!

I am an independent developer trying to help fellow developers and students to resolve issues faced on a day-to-day basis, we 'Code to Care' . There is a lot of expenses involved in hosting and managing a website that's the reason we have ads.

A humble request to you to disable adBlocker on Code2care.org and support us pay our bills.

Thanks,
Cod2care - Line's of code for change.

To see contents reload page after unblocking
Code2care is an initiative to publish and share varied knowledge in programming and technical areas gathered during day-to-day learnings and development activities. Students and Software Developers can leverage this portal to find solutions to their various queries without re-inventing the wheel by referring to our easy to understand posts. Technical posts might include Learnings, Video Tutorials, Code Snippets, Tips-n-tricks, How Tos, Blogs, Articles, etc. on various platforms like Windows, Mac, Linux, Mobile platforms, etc. Technologies/Languages like Java, Objective-C, PHP, .Net, Android, SharePoint, jQuery, HTML, CSS, etc.