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
125 views
in Technique[技术] by (71.8m points)

Android Support Library v7: Error retrieving parent for item

I am trying to build the Android Support Library v7 samples.

For that, I created an sampleproject through Eclipse -> New Android Sample Project and added the android-support-v7-* projects as "Android Project From Existing Code" to Eclipse, and made the sample project reference them.

But I am getting the following errors in android-support-v7-mediarouter/res/values/styles.xml:

error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.ActionButton'. (line 18)

error: Error retrieving parent for item: No resource found that matches the given name 'Widget.AppCompat.Light.ActionButton'. (line 28)

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

question from:https://stackoverflow.com/questions/18964902/android-support-library-v7-error-retrieving-parent-for-item

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

1 Answer

0 votes
by (71.8m points)

You must make the android-support-v7-mediarouter project "aware" of the android-support-v7-appcompat project as a referenced library.

  1. Right click android-support-v7-mediarouter project, select Properties
  2. Select Android
  3. In the Library section at the bottom, click Add....
  4. Select android-support-v7-appcompat in the dialog.
  5. Click Apply.
  6. Click OK.
  7. Do a clean build on the android-support-v7-mediarouter project.

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

...