【问题标题】:No resource found that matches the given name: attr 'android:actionModeShareDrawable'找不到与给定名称匹配的资源:attr 'android:actionModeShareDrawable'
【发布时间】:2014-11-07 05:38:34
【问题描述】:

我尝试同步 Gradle 的所有内容都会出现此错误。我正在使用 SDK 21,并且已安装所有更新。我尝试删除 Value.xml,清理 Gradle,同步它并尝试更改 SDK 版本。还是会出现。

这就是问题所在

C:\Users\User\AndroidStudioProjects\MyApplication\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\21.0.0\res\values-v11\values.xml
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
Error:(36, 21) No resource found that matches the given name: attr 'android:actionModeShareDrawable'.
    Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Button'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Caption'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display1'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display2'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Display3'.

如果您希望看到该项目,请给我留言。 我对 android studio 真的很陌生。我也重建了应用程序。

【问题讨论】:

标签: android gradle resources


【解决方案1】:

您需要确保所有将支持库作为依赖项的模块也将编译 SDK 设置为 21。因此请转到项目结构并检查左侧的所有模块。

【讨论】:

  • 是否有一个很好的描述与所有支持内容以及 Gradle 和 Studio 的关系。真的这太乱了!似乎Android是一个大黑客。我认为 Studio 应该自动更新这个,为什么开发人员需要手动更改它以适应?
【解决方案2】:

将 compileSdkVersion 和 buildToolsVersion 更新到最新的可用版本对我有用。 这些设置对我有用:

compileSdkVersion 26

buildToolsVersion '26.0.1'

【讨论】:

    猜你喜欢
    • 2015-05-19
    • 2014-12-13
    • 2014-12-23
    • 2015-01-31
    • 2017-10-13
    • 2018-03-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多