appcompat_v7:错误检索父项:未发现的资源匹配给定名称

appcompat_v7:错误检索父项:未发现的资源匹配给定名称

问题描述:

我试图构建一个使用appcompat_v7库中的Andr​​oid项目。

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

对于这一点,我通过Eclipse中创建了我的项目 - >新的Andr​​oid示例项目,并添加我的自定义styles.xml,然后加入appcompat_v7库项目 - >属性 - > Android的 - >添加

For that, I created my project through Eclipse -> New Android Sample Project and added my custom styles.xml and then added the appcompat_v7 library Project -> Properties -> Android -> Add.

不过,我收到以下错误appcompat_v7 / RES /价值/ styles_bas​​e.xml当我编译我的项目:

But I am getting the following errors in appcompat_v7/res/values/styles_base.xml when I compile my project:

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'.

在我的表现我已经宣布14作为我的minSdkVersion和19 targetSdkVersion:

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

AndroidManifest.xml中:

AndroidManifest.xml:

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

我能做些什么来修复这些错误,并建立我的项目?

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

检查生成项目和appcompat_v7库项目的目标。他们应该是一样的,如果你的项目有较少的构建目标比你得到这个错误,就无法建立。

Check Build Target of your project and appcompat_v7 library project. They should be same, if your project has lesser Build Target than you get this error and won't be able to build.

要解决在Eclipse中的问题去项目 - >属性 - > Android的(工程建设目标),然后选择等于你appcompat库项目。

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