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

后端 未结 14 1900
不思量自难忘°
不思量自难忘° 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:06

    What I recomend is: (This works to me after many days with errors)

    -Make sure that you have downloaded:

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

    -Redowload the ADT

    -Make a security copy of your project.

    -You must have the ADT, the workspace and the project that we will import in the same disk (e.g. C:/)

    1. Now delete the app compat and your project.

    2. In eclipse: File > Import > Android existing project > Next > Browse (The folder where you have your ADT)/sdk/extras/android/v7/appcompat > Import > Finish

    3. Now in the eclipse Package Explorer: android-support-v7-appcompat/libs/ Make on the two JARS: Right click > Build Path > Add to Build Path

    4. Right click on libs/ folder > Buil Path > Configure Build Path and check this two JARS > OK

    5. On the upper eclipse bar > Project > Clean

    6. Import your project > File > Import > Browse your project > Finish

    7. Now, Right click on the projectfile and android-support-v7-appcompat > Properties > Android > And select the latest API that appears > OK

    8. Right click on the projectfile > Properties > Android > Add > android-support-v7-appcompat

    9. On the upper eclipse bar > Project > Clean

    0 讨论(0)
  • 2020-11-22 05:06

    My problem was that I had other libraries that my project referenced and those libraries had another version of appcompat referenced. This is what I did to resolve the issue:

    (You should back up your project before doing this)

    1) I deleted all the appcompat layout folders (ex: /res/layout-v11).

    2) Solved the problems that arose from that, usually an error in menu.xml

    3) Back to main project and add appcompat library, clean, and everything works!

    0 讨论(0)
  • 2020-11-22 05:13

    In Android Studio I was trying to set the compileSdkVersion and targetSdkVersion to 19.

    My solution was to replace at the bottom of build.gradle, from this:

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

    To the older version of the appcompat library:

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:19.+'
    }
    
    0 讨论(0)
  • 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!

    0 讨论(0)
  • 2020-11-22 05:17

    Upgrading to latest gradle plugin solve my problem :

    classpath 'com.android.tools.build:gradle:0.13.+'
    
    0 讨论(0)
  • 2020-11-22 05:19

    `Follow below steps:

    its working for me.To resolve this issue,

    1.Right Click on appcompat_v7 library and select Properties

    2.Now, Click on Android Option, Set Project Build Path as Android 5.0 (API level 21) Apply Changes.

    3.Now go to project.properties file under appcompat_v7 library,

    4.Set the project target as : target=android-21

    5.Now Clean + Build appcompat_v7 library and your projects`

    0 讨论(0)
提交回复
热议问题