Android支持库appcompat_v7 v21.0.1出错

时间:2014-11-12 08:10:04

标签: android android-support-library android-appcompat

在更新sdk和支持库之前,每件事都运行良好。更新后我刚刚添加了支持库(意味着用资源导入了支持库)。一旦我添加它我得到以下错误

错误:

    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\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-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\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-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\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-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\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-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\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-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v17\styles_rtl.xml:20: error: Error: No resource found that matches the given name: attr 'android:layout_marginStart'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v17\styles_rtl.xml:25: error: Error: No resource found that matches the given name: attr 'android:paddingEnd'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v17\styles_rtl.xml:24: error: Error: No resource found that matches the given name: attr 'android:paddingStart'.       
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v21\themes_base.xml:26: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v21\themes_base.xml:31: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v21\themes_base.xml:36: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Dialog'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v21\themes_base.xml:41: error: Error retrieving parent for item: No resource found that matches the given name 'android:Theme.Material.Light.Dialog'.
    [2014-11-12 13:28:16 - android-support-v7-appcompat] 
    [2014-11-12 13:28:16 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-v11\themes_base.xml:338: error: Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.

将我的构建目标从17更改为21后,我收到了这些错误

[2014-11-12 13:33:15 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-large-v14\themes_base.xml:19: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.DialogWhenLarge.Base'.
[2014-11-12 13:33:15 - android-support-v7-appcompat] 
[2014-11-12 13:33:15 - android-support-v7-appcompat] E:\Android Projects\android-support-v7-appcompat\res\values-large-v14\themes_base.xml:22: error: Error retrieving parent for item: No resource found that matches the given name 'Theme.Base.AppCompat.Light.DialogWhenLarge.Base'.
[2014-11-12 13:33:15 - android-support-v7-appcompat]

我尝试过很多东西,例如再次导入项目,更改project.properties文件等,我无法解决问题

请提前帮助我。

2 个答案:

答案 0 :(得分:5)

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

target=android-19

target=android-21

更改上述关闭项目后再打开并清理

答案 1 :(得分:0)

我想评论,但我的声誉太低了。 我在更换电脑时遇到了同样的问题,所以我习惯从旧电脑中导出库并将其导入到新的电脑中。你可以尝试一下,但我不能保证它也适合你。 如果需要,可以使用我导出的库。尽管它没有多大意义,但出于某种原因它在那之后对我有用。 https://www.dropbox.com/s/ly9mhmlvthk15f9/Libraries.zip?dl=0