Error retrieving parent for item: No resource found that matches the given name after upgrading to AppCompat v23

后端 未结 24 1429
孤城傲影
孤城傲影 2020-11-22 02:30

I\'ve always programmed Android with Eclipse and decided to start migrating to Android Studio. I decided to use the same SDK I already had for Eclipse, then:

  • S
相关标签:
24条回答
  • 2020-11-22 03:06

    In my case it was an higher version of Google-play-services. I set them to 7.0.0 (not 8.x) and all was ok.

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

    As others have already mentioned your compile sdk version must match your support library's major version. This is however, also relevant for subprojects should you have any.

    In case you do, you can set your subprojects compile sdk versions with the following script:

    subprojects { subproject ->
    afterEvaluate{
        if((subproject.plugins.hasPlugin('android') || subproject.plugins.hasPlugin('android-library'))) {
            android {
                compileSdkVersion rootProject.ext.compileSdkVersion
                buildToolsVersion rootProject.ext.buildToolsVersion
            }
          }
       }
    }
    

    Add this script in your root build.gradle file.

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

    I wanted to downgrade from API 23 to 22 and got this error. I had to change all build.gradle files in a project in order to compile.

    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.1"
    
        defaultConfig {
            applicationId "com.yourapp.app"
            minSdkVersion 14
            targetSdkVersion 22
        }
    ...
    dependencies {
        compile 'com.android.support:appcompat-v7:22.2.1'
        compile 'com.android.support:support-v4:22.2.1'
        compile 'com.android.support:design:22.2.1'
        compile 'com.google.android.gms:play-services-gcm:10.0.1'
    }
    
    0 讨论(0)
  • 2020-11-22 03:14

    Another solution : navigate to

    \sdk\extras\android\m2repository\com\android\support\appcompat-v7\23.x.x
    

    open .aar file with 7-zip or winrar , in res folder remove values-23 folder and save changes .

    0 讨论(0)
  • 2020-11-22 03:15

    Everything is great but none of you explained where to download the SDK build tools

    0 讨论(0)
  • 2020-11-22 03:15

    Upgrade Android Studio.

    I had this issue with Android Studio 1.3.1 and none of the other answers worked for me, but after updating to 1.5.1 there were no problems.

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