【问题标题】:Android Support Library appcompat_v7 v21.0.1 gives errorAndroid 支持库 appcompat_v7 v21.0.1 给出错误
【发布时间】:2015-01-09 00:22:50
【问题描述】:

在更新 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 文件等,我无法解决问题

请帮助我提前谢谢。

【问题讨论】:

  • 一旦重启你的 Eclipse !!!
  • 从 values-v14 文件夹中删除这个主题或包含材料设计库
  • 您从哪里获得 v21.0.1?我在野外看到的最后一个版本是 21.0.0
  • @Duggu 也试过了..
  • @SuhailMehta 材料设计库意味着..?

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


【解决方案1】:

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

【讨论】:

  • 添加您的库后,我收到此错误 Jar mismatch!修复你的依赖项
  • 我希望你能关注那里的人回答。这也是我用的。
【解决方案2】:

修改project.properties文件,里面有:

target=android-19

target=android-21

以上更改后关闭项目,然后打开并清理

【讨论】:

  • 现在我记得我上次这样做了。好提醒。谢谢。 :)
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-07-12
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多