当试图在我的项目中使用最新的appcompat-v7支持库时,我得到以下错误:

/Users/greg/dev/mobile/android_project/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'.

我怎么解决这个问题?


当前回答

“遵循以下步骤:

这对我很有用。为了解决这个问题,

1.右键单击appcompat_v7库并选择属性

2.现在,点击Android选项, 将项目构建路径设置为Android 5.0 (API级别21) 应用更改。

3.现在进入项目。appcompat_v7库下的属性文件,

4.设置项目目标为:target=android-21

5.现在Clean + Build appcompat_v7库和你的项目

其他回答

如果你不想使用API 21作为目标API,因此你不想使用材质主题,你必须使用属于API 19 >的旧版本

compile "com.android.support:appcompat-v7:19.0.+"

这也有助于解决你的问题,这只取决于你想要实现什么。

我在游戏服务5.0.89中遇到过这个问题。升级到6.1.11解决了这个问题。

我在工作空间中添加了另一个项目,并试图在清单文件中引用它的一个活动,但我得到了这个错误。问题是我没有正确地引用库。下面是我解决问题的方法:

右键单击项目 选择属性 点击左边菜单上的Android 点击添加 请选择一个图书馆计划

jar进入Android Dependencies文件夹,这个错误已经修复。

确保在android studio(或eclipse)中清理项目,

它应该能解决你的问题

在Android Studio中,我试图设置compileSdkVersion和targetSdkVersion为19。

我的解决方案是在构建的底部进行替换。Gradle,从这里:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:21.0.3'
}

旧版本的appcompat库:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:19.+'
}