android - 找不到与给定名称 : attr 'android:actionModeShareDrawable' appcompat-v7:21. 0.0 与 compileSdkVersion 21 匹配的资源

标签 android android-appcompat material-design

我正在尝试在我的一个项目中使用 Material Design。但是我对 appcompat-v7:21.0.0 库的体验非常糟糕。在 Android Studio 中添加依赖项并开始同步后,我收到以下错误。

Error: No resource found that matches the given name: attr 'android:actionModeShareDrawable'.

No resource found that matches the given name: attr 'android:overlapAnchor'.

但我确信我正在使用最新的构建工具针对最新的 SDK 21 进行编译。这是我的构建配置。

android {
compileSdkVersion 21
buildToolsVersion '21.0.1'

defaultConfig {
    minSdkVersion 15
    targetSdkVersion 21
    versionCode 3
    versionName "0.0.003"
}
buildTypes {
    release {
        runProguard false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
    }
}
}

我在这里做错了什么?它对其他人有用吗? 这是我的其他依赖项,仅供引用。有谁经历过这一步,请指导我。

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile files('libs/smartconfiglib.jar')
compile 'com.android.support:support-v4:21.0.0'
compile 'com.crashlytics.android:crashlytics:1.1.13'
compile 'com.google.android.gms:play-services:6.1.11'
compile 'com.jakewharton.hugo:hugo-runtime:1.1.0'
compile 'com.squareup.retrofit:retrofit:1.7.1'
compile 'com.android.support:appcompat-v7:21.0.0'
compile 'com.android.support:cardview-v7:21.0.0'
compile 'com.jakewharton:butterknife:5.1.2'
compile 'de.greenrobot:eventbus:2.2.1'
compile 'fr.avianey:facebook-android-api:+@aar'
compile('de.keyboardsurfer.android.widget:crouton:1.8.4@aar') {
    exclude group: 'com.google.android', module: 'support-v4'
}
apt 'com.turbomanage.storm:storm-impl:0.99'
compile 'com.turbomanage.storm:storm-api:0.99'
compile 'com.squareup.picasso:picasso:2.3.4'
compile 'com.astuetz:pagerslidingtabstrip:1.0.1'
compile 'com.apptentive:apptentive-android:1.6.+@aar'
compile 'com.github.flavienlaurent.datetimepicker:library:0.0.2'

最佳答案

进入您的 Android SDK 管理器并删除两个以下 SDK 平台:

  • L 预览版 SDK 平台
  • API 21 SDK 平台

然后继续并重新安装 API 21 SDK 平台

这帮我修好了!查看此 details .

关于android - 找不到与给定名称 : attr 'android:actionModeShareDrawable' appcompat-v7:21. 0.0 与 compileSdkVersion 21 匹配的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26608996/

相关文章:

android - 如何自定义 AppCompatButton 颜色

android - 如何在使用 Apache Ant 编译的项目中包含 ActionBar

android - 在 Lollipop 设备上使用 AppCompat-21 崩溃

android - 重新创建 Activity 时,底部工作表保留在屏幕上

android - 带复选框的 ListView 项目 - 如何删除复选框波纹效果?

java - 在 C#/Unity 中启动外部 Android 应用程序

android - Activity 中的多个 ViewPagers

Android Instant 应用程序无法通过应用程序链接在我的 Beta 预发布测试中运行

android - ICS 上的支持库 v21 不支持 ActionMode?

android - 布局中其他 View 隐藏的 Material 波纹效果