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

后端 未结 24 1161
孤城傲影
孤城傲影 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 02:57

    When you update your Android Studio, it uses API version 23 by default, which is the main reason of its occurrence. So,

    At first, check your AppCompat version in build.gradle(Module:app) That is,

    If after changing to 23 there occurs an error then just download

    Compile Sdk Version to API 23, and Build Tools Version to 23.0.0

    from SDK Manager. If already downloaded then:

    1. Go to SDK Manager and
    2. Under Project Structure, change *Compile SDK Version* to API 23, and *Build Tools Version* to 23.0.0
    

    Click SDK Manager Button and open the dialog.

    Click SDK Platform and check if Android 6.0 is downloaded or not.

    if not, then download that first. After completing the download, click Apply.

    Now you need to apply changes to your project from setting. Then press Ctrl + Alt + Shift + S to open setting

    1. Click app from list.
    2. Click properties
    3. Change your Compile SDK Version to API 23
    4. Change your Build Tools Version to 23.0.0

    Don't forget to rebuild your project.

    Then your error will be gone.

    0 讨论(0)
  • 2020-11-22 02:59

    You should compile your project with latest version so update & install from your SDK. Sync your project with sync project with Gradle file Button.
    You can also continue with the existing version but check it installed properly below image indicate to API 22 that is properly installed.

    And sync your project if needed.

    it may help.

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

    This is what helped me: Adding specific android platform

    What should be done is the following... In my case it was cordova but the same is relevant for ionic, phonegap and other frameworks like these:

    1. list all platforms installed for your project: cordova platform list. You'll see something like this:

    1. remove the android platform: cordova platform remove android.

    2. then add the specific android platform: cordova platform add android@5.0.0.

    Good luck! :)

    0 讨论(0)
  • 2020-11-22 03:03
    android {
        compileSdkVersion 23
        buildToolsVersion '23.0.1'
    
    defaultConfig {
        applicationId ""
        minSdkVersion 14
        targetSdkVersion 22
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
      }
    }
    
    dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.google.code.gson:gson:2.3.1'
    compile 'com.android.support:recyclerview-v7:23.0.0'
    compile 'com.android.support:appcompat-v7:23.0.1'
    }
    
    0 讨论(0)
  • 2020-11-22 03:04

    You need to set compileSdkVersion to 23.

    Since API 23 Android removed the deprecated Apache Http packages, so if you use them for server requests, you'll need to add useLibrary 'org.apache.http.legacy' to build.gradle as stated in this link:

    android {
        compileSdkVersion 23
        buildToolsVersion "23.0.0"
        ...
    
        //only if you use Apache packages
        useLibrary 'org.apache.http.legacy'
    }
    
    0 讨论(0)
  • 2020-11-22 03:05

    Your compile SDK version must match the support library's major version.

    Since you are using version 23 of the support library, you need to compile against version 23 of the Android SDK.

    Alternatively you can continue compiling against version 22 of the Android SDK by switching to the latest support library v22.

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