Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No resource found that matches the given name: attr 'android:actionModeShareDrawable' appcompat-v7:21.0.0 with compileSdkVersion 21

I am trying to use Material Design in one of my projects. But I am having a very bad experience with the appcompat-v7:21.0.0 library. As soon as I add the dependency and start sync in Android Studio, I am getting the following error.

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

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

But I am sure that I am compiling against the latest SDK 21 with the latest build tools. Here is my build config.

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'
    }
}
}

What is the mistake that I am doing here? Is it working for everybody else? Here are my other dependencies FYI. Someone who has been through this step, please guide me.

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'

}

like image 382
Gopinath Avatar asked Oct 28 '14 12:10

Gopinath


2 Answers

Go into your Android SDK Manager and delete both of the following SDK platforms:

  • L Preview SDK Platform
  • API 21 SDK Platform

Then go ahead and reinstall the API 21 SDK Platform.

That fixed it for me! See this for details.

like image 178
Gautam Avatar answered Sep 27 '22 23:09

Gautam


I was facing the same issue. Please check your build.gradle file and change the gradle dependency to

classpath 'com.android.tools.build:gradle:0.12.1'

from

classpath 'com.android.tools.build:gradle:0.12.+'

Make sure your sdk is updated to version 21 and in your gradle compileSdkVersion is 21

I hope this will work for you.

like image 38
Ankit Avatar answered Sep 28 '22 00:09

Ankit