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

后端 未结 24 1343
孤城傲影
孤城傲影 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:15

    If you are using phonegap(cross-platform) and got same issue above, just remove the android platform using below command.

    phonegap platform remove android

    And add it again.

    phonegap platform add android

    Then problem solved for me.

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

    This issue is raised because now the compile SDK version must match the Android Support library's major version.

    In my case i have the Android Support Library version 23, so i had to compile against the Android SDK version 23, and I had to change this in my build.gradle file:

    Well some of you will need to install the SDK, Android 6.0 (API 23)

    and don´t forget to Sync project with gradle files

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

    I found the solution, Problem started when I updated sdk, after that I used different buildToolsVersion ('22.0.1') and I was using different support library like compile 'com.android.support:appcompat-v7:23.0.0', showing you in image below

    This was raising problem of "android.widget.Material..." Then I used same version for support library like compile 'com.android.support:appcompat-v7:22.0.1' and its DONE. (Showing you in below screenshot)

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

    If you are getting errors even after downloading the newest SDK and Android Studio, here is what I did:

    1. Download the most recent SDK
    2. Open file-Project structure (Ctrl + Alt + Shift + S)
    3. In modules, select app
    4. In the properties tab: Change compile SDK version to API 23 Android 6.0 marshmallow (latest)

    I hope it helps someone so that he won't suffer like I did for these couple of days.

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

    Your compile SDK version must match the support library major version. This is the solution to your problem. You can check it easily in your Gradle Scripts in build.gradle file. Fx: if your compileSdkVersion is 23 your compile library must start at 23.

      compileSdkVersion 23
        buildToolsVersion "23.0.0"
        defaultConfig {
            minSdkVersion 15
            targetSdkVersion 23
            versionCode 340
            versionName "3.4.0"
        }
    dependencies {
        compile 'com.android.support:appcompat-v7:23.1.0'
        compile 'com.android.support:recyclerview-v7:23.0.1'
    }
    

    And always check that your Android Studoi has the supported API Level. You can check it in your Android SDK, like this:

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

    As pointed out by Tanis.7x, the support library version (23) does not match the targetSdkVersion (22)

    You can fix this by doing the following:

    In the build.grade file of your app module, change the following line of code

    compile 'com.android.support:appcompat-v7:23.0.0'
    

    To

    compile 'com.android.support:appcompat-v7:22.+'
    

    This will use the latest version of the appcompat version that is compatible with SdkVersion 22.

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