1

Am new for android development. Am using eclipse for creating android projects. I tried to create a new sample in a newly created workspace with Target SDK as API 21 and Compiled with API 19. I have installed the SDKs of API 19 and 20 and all its updates. While trying to compile the newly created project I ended up with the below error. Can anyone help me how to get rid of this?

Description Resource    Path    Location    Type
error: **Error retrieving parent for item: No resource found that matches the given name** '@android:TextAppearance.Material.SearchResult.Subtitle'.    styles_base.xml /appcompat_v7/res/values-v21    line 168    Android AAPT Problem
Description Resource    Path    Location    Type
error: Error retrieving parent for item: No resource found that matches the given name '@android:TextAppearance.Material.SearchResult.Title'.   styles_base.xml /appcompat_v7/res/values-v21    line 164    Android AAPT Problem
Description Resource    Path    Location    Type
error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body1'. styles_base_text.xml    /appcompat_v7/res/values-v21    line 38 Android AAPT Problem
error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Body2'. styles_base_text.xml    /appcompat_v7/res/values-v21    line 36 Android AAPT Problem

and so on....... I dont know what went wrong. Can anyone guide me in building the project successfully?

Tim
  • 41,901
  • 18
  • 127
  • 145
Harikrishnan
  • 1,474
  • 2
  • 11
  • 25

2 Answers2

1

See http://code.google.com/p/android/issues/detail?id=72991#c8 :

Delete the values-v21 folder on app/src/main/res/, it is not important if you are not using android-L

The above is for Android Studio, For Eclipse it's just in res subfolder of project root.

Also you can try to build with SDK 21, as mentioned here: https://stackoverflow.com/a/26437523/1028256 and https://stackoverflow.com/a/24437408/1028256

Seems that the New Project Wizard in Eclipse generated files for SDK 11, including files for appcompat-v7, so you either need to compile with API 21, or remove those files from the project.

Community
  • 1
  • 1
Mixaz
  • 4,068
  • 1
  • 29
  • 55
  • Hi Mixaz, I tried deleting the values-21 folder. However I still face the same error as the themes_base.xml still throws error that "No resource found that matches the given name". – Harikrishnan Oct 29 '14 at 11:12
  • All am left with is to update to Android 5. I have tried all other options. Is there any other way to fix this issue, without updating to Android 5? I need to compile the project in Android 4.4.2 API 19. – Harikrishnan Oct 29 '14 at 11:15
  • It looks like that Eclipse New Project Wizard created a project for API 21. You can try to re-create a new project with API 19, just to double-check you did everithing correctly. If it doesn't help, I would try to import any existing project/example into Eclipse, and build it against API 19. There's 'samples' subfolder in Android SDK. I see that samples for android-19 go for Android Studio (gradle build), but android-17 samples appear to be for android-17. Try to import them into Eclipse, it's somewhere in 'File' menu (I'm using Android Studio at the moment) – Mixaz Oct 30 '14 at 11:38
  • I tried opening a new project with Compile version API 19. But ended up in the same error. And all I did is, installed the Android 5 and Build tool 21.0.1 and the errors got cleared. However I still have a doubt. I could work on the new projects in the workspace that I created, however If I try importing an existing project to the workspace which has different compile version less than 21, I could not run it. I have created a new workspace and imported the old projects and it worked. Is this problem is because I have appcampat Compiling with 21 in the workspace or Is it a Behavior of eclipse? – Harikrishnan Oct 31 '14 at 05:12
0

I had the same or similar errors when I tried to compile the GCM Client sample.

I solved it by specifying the correct version in build.gradle. Change:

dependencies {
    compile 'com.android.support:appcompat-v7:+'
}

to

dependencies {
    compile 'com.android.support:appcompat-v7:19.0.0'
}

I suppose it's best to set the version number for your dependencies to be the same as your targetSdkVersion.

It took me quote some time to figure out and the irony is that Android Studio was already hinting at it: "Avoid using + in version numbers; can lead to unpredictable and unrepeatable builds."

update

I just realized you said you "are using Eclipse" which I don't know at all. I suppose you should look for the mechanism where you pull in the app-compat dependency and tell it to use a specific version instead of the newest. Hopefully others can tell you where that is.

Rob Meeuwisse
  • 2,847
  • 1
  • 17
  • 21