resource error in android studio after update: No Resource Found

James Dobson picture James Dobson · Aug 19, 2015 · Viewed 123k times · Source

After a recent update to Android Studio, we're having problems getting a project to compile that previously worked. At first we were getting the following error:

/Users/james/Development/AndroidProjects/myapp/app/build/intermediates/exploded-aar/com.android.support/appcompat-v7/23.0.0/res/values-v23/values-v23.xml
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Inverse'.
Error:(2) Error retrieving parent for item: No resource found that matches the given name 'android:Widget.Material.Button.Colored'.

I updated the sdk build target in our gradle file to 23, which made this specific issue go away, but it left us with a ton of apache.http package errors (specifically, a ton of apache packages we use for http stuff are now gone in sdk 23).

What I want to do is solve the strange resource error, but without updating to sdk 23. I don't have the time to re-write our tools library right now to use whatever new implementation of apache http components has been issued. Does anyone have any ideas?

Answer

Roberto B. picture Roberto B. · Aug 20, 2015

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'
}