Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
347 views
in Technique[技术] by (71.8m points)

android - appcompat_v7: Error retrieving parent for item: No resource found that matches the given name

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

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.

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

In my manifest I have 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?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...