Appcompat_v7: Error getting parent element for element: resource not found that matches the specified name

I am trying to create an Android project that uses the appcompat_v7 library.

To do this, I created my project through Eclipse → New Android Sample Project and added my custom styles.xml, and then added the appcompat_v7 Project library → Properties → Android → Add.

But when I compile my project, I get the following errors in appcompat_v7 / res / values ​​/styles_base.xml:

appcompat_v7/res/values/styles_base.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:84: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:166: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:243: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:261: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base.DropDownItem'. appcompat_v7/res/values/styles_base.xml:319: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:323: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.Base'. appcompat_v7/res/values/styles_base.xml:347: error: Error retrieving parent for item: No resource found that matches the given name 'TextAppearance.AppCompat.Base'. appcompat_v7/res/values/styles_base.xml:391: error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Base'. appcompat_v7/res/values/themes_base.xml:189: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.AppCompat.Base'. 

In my manifest, I declared 14 as my minSdkVersion and 19 as targetSdkVersion:

AndroidManifest.xml:

 <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" /> 

What can I do to fix these errors and build my project?

+15
android coding-style appcompat android-styles android-theme
Apr 22 '14 at 10:12
source share
6 answers

Check the assembly of the project project and the appcompat_v7 library project. They should be the same if your project has a smaller build goal than you get this error and cannot build.

To fix the problem in Eclipse, go to Project-> Properties-> Android (Project Build Target) and select the application library equal to your project.

+18
Jun 23 '14 at 9:57
source share
  • Right click on the supporting library;
  • Click Properties;
  • On the left side, click "Android";
  • Select the correct "Android 5.0 - API 21" and click "OK";
  • Clean up the support library: Project → Clean;

Repeat the above steps for your project.

+12
Nov 03 '14 at 8:12
source share

When using the appcompat_v7 library, targetSdkVersion should have the same number as the main Android support version number. For example. on my SDK installation the version number is 23.0.1 and so my targetSdkVersion should be 23 (Android 6.0)

+2
Oct 10 '15 at 9:46
source share

I encountered a similar problem when updating appcompat-v7 from 22.2.0 to 23.1.0. Update compileSdkVersion to 23 fixed.

+1
Nov 03 '15 at 1:44
source share

Try the following: https://www.youtube.com/watch?v=HpXoCfoX_QY

Also, make sure your library "appcompat_v7" is open and you see the folders.

0
Dec 11 '15 at 17:21
source share

Check if the supporting libraries Android and Android SDK Build-tools and Android SDK Platform-tools are updated. I updated Android Support Library, not Build-tools, and this error appeared. After updating Build-tools, he decided.

-one
Sep 14 '15 at 5:16
source share



All Articles