Android Support Library v7: Error retrieving parent for item

北城以北 提交于 2020-01-09 04:38:40

问题


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.

  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.


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!