8

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'

}

Gopinath
  • 12,981
  • 6
  • 36
  • 50
  • have you seen http://stackoverflow.com/questions/26457096/appcompat-v7-r21-returning-error-in-values-xml? – Shayan Pourvatan Oct 28 '14 at 13:00
  • possible duplicate of [appcompat-v7:21.0.0': No resource found that matches the given name: attr 'android:actionModeShareDrawable'](http://stackoverflow.com/questions/26431676/appcompat-v721-0-0-no-resource-found-that-matches-the-given-name-attr-andro) – reVerse Oct 28 '14 at 14:37
  • @shayanpourvatan The solution does not work. My problem is that I am already using the latest build tools (21.0.1), SDK platform (21). Still it does not work. – Gopinath Oct 29 '14 at 06:41
  • @reVerse it is not a duplicate. I am already following the solution given in that answer but the problem seems to be something else. That's why I have posted a separate question – Gopinath Oct 29 '14 at 06:42
  • Sorry, seems like I misjudged this one. Just a thought: Have you tried to use the `appcompat-v7` in another project? (Just to determine if it is a general or a module-related problem) – reVerse Oct 29 '14 at 07:58
  • I didn't try it yet on a new project. Will try it once I get some time off of my current work. :) – Gopinath Oct 29 '14 at 09:47
  • I have the same problem. I created a new project with appcompat-v7:21.0.0 and the same problem is happening. If I change the dependencie to appcompat-v7:20.0.0, it works, but that's not a solution. I have been stuck on this for two days. I don't know what else I can do to fix it. – Cristopher Oyarzún Altamirano Oct 29 '14 at 15:41
  • I'm having the same issue. This seems like it could be related - https://code.google.com/p/android/issues/detail?id=77893 – Gautam Oct 31 '14 at 00:42

2 Answers2

2

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.

Gautam
  • 4,006
  • 3
  • 32
  • 37
1

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.

Ankit
  • 1,916
  • 2
  • 20
  • 33