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

后端 未结 14 1909
不思量自难忘°
不思量自难忘° 2020-11-22 05:03

When attempting to use the latest appcompat-v7 support library in my project, I get the following error:

/Users/greg/dev/mobile/android_project/app/build/int         


        
14条回答
  •  不思量自难忘°
    2020-11-22 05:17

    This is likely because you haven't set your compileSdkVersion to 21 in your build.gradle file. You also probably want to change your targetSdkVersion to 21.

    android {
        //...
        compileSdkVersion 21
    
        defaultConfig {
            targetSdkVersion 21
        }
        //...
    }
    

    This requires you to have downloaded the latest SDK updates to begin with.

    Android Studio SDK Manager

    Once you've downloaded all the updates (don't forget to also update the Android Support Library/Repository, too!) and updated your compileSdkVersion, re-sync your Gradle project.

    Edit: For Eclipse or general IntelliJ users

    See reVerse's answer. He has a very thorough walk through!

提交回复
热议问题