当试图在我的项目中使用最新的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'.

我怎么解决这个问题?


当前回答

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

其他回答

我是最新的一切,仍然得到这个错误,不确定为什么,但我认为图像是以一种奇怪的方式损坏的,在替换图像后,我摆脱了这个错误。 可能值得尝试不同的图像:)

我的建议是:(这对我来说是有效的,经过许多天的错误)

-确保你已经下载:

- the Lastest SDK Platform from the latest Android version
- Android Suppor Librarie and Repository from EXTRAS 

重新下载ADT

-制作项目的安全副本。

-你必须将ADT,工作区和项目导入到同一个磁盘(例如C:/)

Now delete the app compat and your project. In eclipse: File > Import > Android existing project > Next > Browse (The folder where you have your ADT)/sdk/extras/android/v7/appcompat > Import > Finish Now in the eclipse Package Explorer: android-support-v7-appcompat/libs/ Make on the two JARS: Right click > Build Path > Add to Build Path Right click on libs/ folder > Buil Path > Configure Build Path and check this two JARS > OK On the upper eclipse bar > Project > Clean Import your project > File > Import > Browse your project > Finish Now, Right click on the projectfile and android-support-v7-appcompat > Properties > Android > And select the latest API that appears > OK Right click on the projectfile > Properties > Android > Add > android-support-v7-appcompat On the upper eclipse bar > Project > Clean

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

当我将编译SDK版本从API:21更改为API:16时,我得到了同样的错误。问题是,appcompat版本。如果你需要使用旧版本的android API,那么你也必须改变这个appcompat版本。在我的情况下(API:16),我必须使用appcompat-v7 . 19.+。

所以我在build中替换了依赖项。Gradle如下,

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

确保你的SDK中有旧版本的appcompat

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

它应该能解决你的问题