Home » Android » Error retrieving parent for item – Android Studio

Error retrieving parent for item – Android Studio

Posted by: admin April 23, 2020 Leave a comment

Questions:

After downloading the New L SDK and 20 SDK when trying to refresh, build, or clean my project i get a

Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Menu'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.
Error:Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Title'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Large'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionBar.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.ActionMode.Subtitle'.
Error:Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.PopupMenu.Small'.

Here is my build.gradle

apply plugin: 'com.android.application'
buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:0.12.+'
    }
}

repositories {
    maven { url 'https://oss.sonatype.org/content/repositories/snapshots' }
}


    signingConfigs{
        release {
           ... Stuff Here ...
        }
    }
    buildTypes {
        debug {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            zipAlign true
            debuggable true
        }
        release {
            runProguard true
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
            zipAlign true
            signingConfig signingConfigs.release

        }
    }

    dexOptions {
        incremental true
    }
}

android {
    compileSdkVersion 'android-L'
    buildToolsVersion '20.0.0'

    defaultConfig {
        minSdkVersion 14
        targetSdkVersion 'L'
    }
}


dependencies {
    compile fileTree(dir: 'libs', include: '*.jar')
    ...
    Some Projects
    ...
    compile 'com.android.support:cardview-v7:+'
    compile 'com.android.support:recyclerview-v7:+'
    compile 'com.android.support:appcompat-v7:+'
}

I feel like ive tried just about everything, I’m not sure what else to try.
Any help would be appreciated.

I just upgraded to the new Android Studio Beta (0.8.0) from 0.6.0 Canary

How to&Answers:

Turns out that I had to make the target and compile version to L which meant that I could not run my app on older SDKs. If you want your app to run on SDK 19 and lower you have to set your compile and target version to 19 and your min SDK to whatever version you need.

Next you have to adjust your imports to the version that is compatible with the SDKs that you have chosen to compile for. For example if you want to use the v7 support library on sdk 19 you must import it like this: compile compile ‘com.android.support:appcompat-v7:20.+’

Answer:

just try this:

    android {
        compileSdkVersion 20
        buildToolsVersion '19.1.0'

        defaultConfig {
            minSdkVersion 14
            targetSdkVersion 20
        }
    }
    dependencies {
        compile 'com.android.support:appcompat-v7:19.+'
    }

and if you have another module in your project, check manifest files in those modules too.

Answer:

Just set your compileVersion to 19 and make sure you are not using the latest compatibility libraries (stick to version 19.1.0). That does the trick for me.

Answer:

If you get similar errors in Eclipse when trying to use compatibility libraries with resources (for example: v7 support library) then:

Right-click the library project folder (for example: android-support-v7-appcompat)

Select Properties

In the category panel on the left side of the dialog, select Android

In the Project Build Target check the same platform version as in your project

Answer:

In Android Studio, nothing above worked unless I compiled and targeted the same version (23 in this case…) and added the specific Google reference to compile Google APIs. which fixed all 99 errors after importing and updating from Eclipse:

compileSdkVersion 'Google Inc.:Google APIs:23'