31

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

animuson
  • 53,861
  • 28
  • 137
  • 147
orrett3
  • 1,038
  • 1
  • 9
  • 15
  • Try setting `targetSdkVersion 20`. – ChemicalFlash Jun 28 '14 at 11:49
  • It turns out that with the new SDK you have to set the target and compile version to 'L' which also means that you cannot run it on an SDK lower than L or 20. – orrett3 Jun 28 '14 at 22:29
  • Check this for more help: https://stackoverflow.com/questions/42144415/error-retrieving-parent-for-item-no-resource-found-that-matches-the-given-name – rafsanahmad007 Jan 15 '18 at 22:05

5 Answers5

40

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.+'

orrett3
  • 1,038
  • 1
  • 9
  • 15
9

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.

Zafer
  • 316
  • 4
  • 13
1

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.

Jeroen
  • 3,399
  • 1
  • 22
  • 25
1

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

vovahost
  • 34,185
  • 17
  • 113
  • 116
0

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'
INSITE MOBILE
  • 133
  • 1
  • 10