更新支持库后出现错误

19

今天发布了Android 5.0,我刚刚更新了我的库。其中一个文件android-support-v7得到更新后,我一直遇到这些错误。

[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:75: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:79: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.CloseMode'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:83: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionButton.Overflow'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:25: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabView'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:29: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabView'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:33: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ActionBar.TabText'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:37: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.ActionBar.TabText'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:65: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:69: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:45: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:49: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:53: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:57: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title.Inverse'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:61: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle.Inverse'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:178: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar.Horizontal'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:182: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ProgressBar'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:113: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:115: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Spinner'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:110: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.DropDownItem.Spinner'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:107: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView.DropDown'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:121: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListView'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:126: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.ListPopupWindow'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:138: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:143: error: Error: No resource found that matches the given name: attr 'android:overlapAnchor'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:129: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.PopupMenu'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:132: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Light.PopupMenu'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:146: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:150: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:154: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:158: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:164: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:168: error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:172: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:174: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.AutoCompleteTextView'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:93: error: Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Toolbar.Button.Navigation'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:97: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base.xml:101: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:62: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:20: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display4'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:24: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:28: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:30: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Headline'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:32: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Title'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:34: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Subhead'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:38: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:40: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:42: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Menu'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 
[2014-10-18 01:05:34 - android-support-v7-appcompat] C:\Program Files (x86)\adt-bundle-windows-x86_64-20140702\sdk\extras\android\support\v7\appcompat\res\values-v21\styles_base_text.xml:60: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
[2014-10-18 01:05:34 - android-support-v7-appcompat] 

我尝试从SDK管理器中删除库并重新下载

我尝试删除库,刷新我的项目,并删除有关android-support-v7-appcompat的构建路径中的每一行

当我重新设置路径时,我导入库然后将其添加到我的项目路径中

仍然没有任何作用,我正在使用ADT(Android Developer Tools),而不是Android Studio

5个回答

39

修改project.properties文件,该文件包含:

target=android-19

target=android-21

在上述更改后关闭项目,然后打开并清理。


使用AppCompat可以工作,但是使用MediaRouter就不行了... 不过,非常感谢你... 你让我免去了去Android Studio的麻烦。 - MohammedAlSafwan
5
谢谢,这对我很有帮助。顺便提醒其他人,你只需要为android-support-v7项目设置这个目标,你可以保持自己项目的设置不变。 - Vincent Nikkelen
^ 错误:https://dev59.com/I2Ag5IYBdhLWcg3wwdLA - worked

2
为了切换到兼容性和支持库的API v21版本,您还需要切换到compileSdkVersion 21和buildToolsVersion '21.0.1'。
在Android Studio中,您可以在build.gradle中设置这些内容。在ADT中,我不记得如何设置它们。

谢谢您的尝试回答,我希望在Android Studio上有人会用到它。 - MohammedAlSafwan

0
如果使用Eclipse,请确保您已经从SDK Manager更新了以下工具:
  1. Android 5.0(API 21)- SDK平台
  2. Android支持库存储库
  3. Android支持库
  4. Google Play服务
  5. Google存储库
  6. 最新的构建工具
更新所有这些工具后,导入v7项目并打开android-support-v7-appcompat的project.properties文件,并将目标从target=android-19更改为target=android-21
清理项目,然后就可以开始了。

0

创建一个新的工作空间,然后尝试使用最小SDK 2.3创建一个新的Android项目,然后它将自动导入您的appcompact库,之后它就可以正常工作了,这对我很有效。


0

我对类似错误的解决方案如下:

1)我通过SDK管理器安装了21个API。

2)我将我的项目构建目标更改为21。 并且 我将v7-appcompat库构建目标更改为21。

最后,我认为支持库项目(v7-appcompat或v7-gridlayout)必须在工作集中。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接