问题
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?
回答1:
You must make the android-support-v7-mediarouter project "aware" of the android-support-v7-appcompat project as a referenced library.
- Right click android-support-v7-mediarouter project, select Properties
- Select Android
- In the Library section at the bottom, click Add....
- Select android-support-v7-appcompat in the dialog.
- Click Apply.
- Click OK.
- Do a clean build on the android-support-v7-mediarouter project.
来源:https://stackoverflow.com/questions/18964902/android-support-library-v7-error-retrieving-parent-for-item